版博士V2.0程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

95 Zeilen
2.2 KiB

  1. /**
  2. * Type defunctionalization (as describe in [Lightweight higher-kinded polymorphism](https://www.cl.cam.ac.uk/~jdy22/papers/lightweight-higher-kinded-polymorphism.pdf))
  3. *
  4. * @since 2.0.0
  5. */
  6. /**
  7. * `* -> *` constructors
  8. * @since 2.0.0
  9. */
  10. export interface HKT<URI, A> {
  11. readonly _URI: URI
  12. readonly _A: A
  13. }
  14. /**
  15. * `* -> * -> *` constructors
  16. * @since 2.0.0
  17. */
  18. export interface HKT2<URI, E, A> extends HKT<URI, A> {
  19. readonly _E: E
  20. }
  21. /**
  22. * `* -> * -> * -> *` constructors
  23. * @since 2.0.0
  24. */
  25. export interface HKT3<URI, R, E, A> extends HKT2<URI, E, A> {
  26. readonly _R: R
  27. }
  28. /**
  29. * `* -> * -> * -> * -> *` constructors
  30. * @since 2.0.0
  31. */
  32. export interface HKT4<URI, S, R, E, A> extends HKT3<URI, R, E, A> {
  33. readonly _S: S
  34. }
  35. /**
  36. * `* -> *` constructors
  37. * @since 2.0.0
  38. */
  39. export interface URItoKind<A> {}
  40. /**
  41. * `* -> * -> *` constructors
  42. * @since 2.0.0
  43. */
  44. export interface URItoKind2<E, A> {}
  45. /**
  46. * `* -> * -> * -> *` constructors
  47. * @since 2.0.0
  48. */
  49. export interface URItoKind3<R, E, A> {}
  50. /**
  51. * `* -> * -> * -> * -> *` constructors
  52. * @since 2.0.0
  53. */
  54. export interface URItoKind4<S, R, E, A> {}
  55. /**
  56. * `* -> *` constructors
  57. * @since 2.0.0
  58. */
  59. export declare type URIS = keyof URItoKind<any>
  60. /**
  61. * `* -> * -> *` constructors
  62. * @since 2.0.0
  63. */
  64. export declare type URIS2 = keyof URItoKind2<any, any>
  65. /**
  66. * `* -> * -> * -> *` constructors
  67. * @since 2.0.0
  68. */
  69. export declare type URIS3 = keyof URItoKind3<any, any, any>
  70. /**
  71. * `* -> * -> * -> * -> *` constructors
  72. * @since 2.0.0
  73. */
  74. export declare type URIS4 = keyof URItoKind4<any, any, any, any>
  75. /**
  76. * `* -> *` constructors
  77. * @since 2.0.0
  78. */
  79. export declare type Kind<URI extends URIS, A> = URI extends URIS ? URItoKind<A>[URI] : any
  80. /**
  81. * `* -> * -> *` constructors
  82. * @since 2.0.0
  83. */
  84. export declare type Kind2<URI extends URIS2, E, A> = URI extends URIS2 ? URItoKind2<E, A>[URI] : any
  85. /**
  86. * `* -> * -> * -> *` constructors
  87. * @since 2.0.0
  88. */
  89. export declare type Kind3<URI extends URIS3, R, E, A> = URI extends URIS3 ? URItoKind3<R, E, A>[URI] : any
  90. /**
  91. * `* -> * -> * -> * -> *` constructors
  92. * @since 2.0.0
  93. */
  94. export declare type Kind4<URI extends URIS4, S, R, E, A> = URI extends URIS4 ? URItoKind4<S, R, E, A>[URI] : any