版博士V2.0程序
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

133 wiersze
3.5 KiB

  1. /**
  2. * A type for natural transformations.
  3. *
  4. * A natural transformation is a mapping between type constructors of kind `* -> *` where the mapping
  5. * operation has no ability to manipulate the inner values.
  6. *
  7. * The definition of a natural transformation in category theory states that `F` and `G` should be functors,
  8. * but the `Functor` constraint is not enforced here; that the types are of kind `* -> *` is enough for our purposes.
  9. *
  10. * @since 2.11.0
  11. */
  12. import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT'
  13. /**
  14. * @since 2.11.0
  15. */
  16. export interface NaturalTransformation<F, G> {
  17. <A>(fa: HKT<F, A>): HKT<G, A>
  18. }
  19. /**
  20. * @since 2.11.0
  21. */
  22. export interface NaturalTransformation11<F extends URIS, G extends URIS> {
  23. <A>(fa: Kind<F, A>): Kind<G, A>
  24. }
  25. /**
  26. * @since 2.11.0
  27. */
  28. export interface NaturalTransformation12<F extends URIS, G extends URIS2> {
  29. <A, E>(fa: Kind<F, A>): Kind2<G, E, A>
  30. }
  31. /**
  32. * @since 2.11.0
  33. */
  34. export interface NaturalTransformation12C<F extends URIS, G extends URIS2, E> {
  35. <A>(fa: Kind<F, A>): Kind2<G, E, A>
  36. }
  37. /**
  38. * @since 2.11.0
  39. */
  40. export interface NaturalTransformation13<F extends URIS, G extends URIS3> {
  41. <A, R, E>(fa: Kind<F, A>): Kind3<G, R, E, A>
  42. }
  43. /**
  44. * @since 2.11.0
  45. */
  46. export interface NaturalTransformation13C<F extends URIS, G extends URIS3, E> {
  47. <A, R>(fa: Kind<F, A>): Kind3<G, R, E, A>
  48. }
  49. /**
  50. * @since 2.11.0
  51. */
  52. export interface NaturalTransformation14<F extends URIS, G extends URIS4> {
  53. <A, S, R, E>(fa: Kind<F, A>): Kind4<G, S, R, E, A>
  54. }
  55. /**
  56. * @since 2.11.0
  57. */
  58. export interface NaturalTransformation14C<F extends URIS, G extends URIS4, E> {
  59. <A, S, R>(fa: Kind<F, A>): Kind4<G, S, R, E, A>
  60. }
  61. /**
  62. * @since 2.11.0
  63. */
  64. export interface NaturalTransformation21<F extends URIS2, G extends URIS> {
  65. <A>(fa: Kind2<F, unknown, A>): Kind<G, A>
  66. }
  67. /**
  68. * @since 2.11.0
  69. */
  70. export interface NaturalTransformation22<F extends URIS2, G extends URIS2> {
  71. <E, A>(fa: Kind2<F, E, A>): Kind2<G, E, A>
  72. }
  73. /**
  74. * @since 2.11.0
  75. */
  76. export interface NaturalTransformation22C<F extends URIS2, G extends URIS2, E> {
  77. <A>(fa: Kind2<F, E, A>): Kind2<G, E, A>
  78. }
  79. /**
  80. * @since 2.11.0
  81. */
  82. export interface NaturalTransformation23<F extends URIS2, G extends URIS3> {
  83. <E, A, R>(fa: Kind2<F, E, A>): Kind3<G, R, E, A>
  84. }
  85. /**
  86. * @since 2.11.0
  87. */
  88. export interface NaturalTransformation23C<F extends URIS2, G extends URIS3, E> {
  89. <A, R>(fa: Kind2<F, E, A>): Kind3<G, R, E, A>
  90. }
  91. /**
  92. * @since 2.11.0
  93. */
  94. export interface NaturalTransformation24<F extends URIS2, G extends URIS4> {
  95. <E, A, S, R>(fa: Kind2<F, E, A>): Kind4<G, S, R, E, A>
  96. }
  97. /**
  98. * @since 2.11.0
  99. */
  100. export interface NaturalTransformation23R<F extends URIS2, G extends URIS3> {
  101. <R, A, E>(fa: Kind2<F, R, A>): Kind3<G, R, E, A>
  102. }
  103. /**
  104. * @since 2.11.0
  105. */
  106. export interface NaturalTransformation23RC<F extends URIS2, G extends URIS3, E> {
  107. <R, A>(fa: Kind2<F, R, A>): Kind3<G, R, E, A>
  108. }
  109. /**
  110. * @since 2.11.0
  111. */
  112. export interface NaturalTransformation24R<F extends URIS2, G extends URIS4> {
  113. <R, A, S, E>(fa: Kind2<F, R, A>): Kind4<G, S, R, E, A>
  114. }
  115. /**
  116. * @since 2.11.0
  117. */
  118. export interface NaturalTransformation24S<F extends URIS2, G extends URIS4> {
  119. <S, A, R, E>(fa: Kind2<F, S, A>): Kind4<G, S, R, E, A>
  120. }
  121. /**
  122. * @since 2.11.0
  123. */
  124. export interface NaturalTransformation33<F extends URIS3, G extends URIS3> {
  125. <R, E, A>(fa: Kind3<F, R, E, A>): Kind3<G, R, E, A>
  126. }
  127. /**
  128. * @since 2.11.0
  129. */
  130. export interface NaturalTransformation34<F extends URIS3, G extends URIS4> {
  131. <R, E, A, S>(fa: Kind3<F, R, E, A>): Kind4<G, S, R, E, A>
  132. }