版博士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.

Bifunctor.d.ts 1.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * @since 2.0.0
  3. */
  4. import { HKT2, Kind2, Kind3, URIS2, URIS3, URIS4, Kind4 } from './HKT'
  5. /**
  6. * @category model
  7. * @since 2.0.0
  8. */
  9. export interface Bifunctor<F> {
  10. readonly URI: F
  11. readonly bimap: <E, A, G, B>(fea: HKT2<F, E, A>, f: (e: E) => G, g: (a: A) => B) => HKT2<F, G, B>
  12. readonly mapLeft: <E, A, G>(fea: HKT2<F, E, A>, f: (e: E) => G) => HKT2<F, G, A>
  13. }
  14. /**
  15. * @category model
  16. * @since 2.0.0
  17. */
  18. export interface Bifunctor2<F extends URIS2> {
  19. readonly URI: F
  20. readonly bimap: <E, A, G, B>(fea: Kind2<F, E, A>, f: (e: E) => G, g: (a: A) => B) => Kind2<F, G, B>
  21. readonly mapLeft: <E, A, G>(fea: Kind2<F, E, A>, f: (e: E) => G) => Kind2<F, G, A>
  22. }
  23. /**
  24. * @category model
  25. * @since 2.0.0
  26. */
  27. export interface Bifunctor2C<F extends URIS2, E> {
  28. readonly URI: F
  29. readonly _E: E
  30. readonly bimap: <A, G, B>(fea: Kind2<F, E, A>, f: (e: E) => G, g: (a: A) => B) => Kind2<F, G, B>
  31. readonly mapLeft: <A, M>(fea: Kind2<F, E, A>, f: (e: E) => M) => Kind2<F, M, A>
  32. }
  33. /**
  34. * @category model
  35. * @since 2.0.0
  36. */
  37. export interface Bifunctor3<F extends URIS3> {
  38. readonly URI: F
  39. readonly bimap: <R, E, A, G, B>(fea: Kind3<F, R, E, A>, f: (e: E) => G, g: (a: A) => B) => Kind3<F, R, G, B>
  40. readonly mapLeft: <R, E, A, G>(fea: Kind3<F, R, E, A>, f: (e: E) => G) => Kind3<F, R, G, A>
  41. }
  42. /**
  43. * @category model
  44. * @since 2.2.0
  45. */
  46. export interface Bifunctor3C<F extends URIS3, E> {
  47. readonly URI: F
  48. readonly _E: E
  49. readonly bimap: <R, A, G, B>(fea: Kind3<F, R, E, A>, f: (e: E) => G, g: (a: A) => B) => Kind3<F, R, G, B>
  50. readonly mapLeft: <R, A, G>(fea: Kind3<F, R, E, A>, f: (e: E) => G) => Kind3<F, R, G, A>
  51. }
  52. /**
  53. * @category model
  54. * @since 2.0.0
  55. */
  56. export interface Bifunctor4<F extends URIS4> {
  57. readonly URI: F
  58. readonly bimap: <S, R, E, A, G, B>(fea: Kind4<F, S, R, E, A>, f: (e: E) => G, g: (a: A) => B) => Kind4<F, S, R, G, B>
  59. readonly mapLeft: <S, R, E, A, G>(fea: Kind4<F, S, R, E, A>, f: (e: E) => G) => Kind4<F, S, R, G, A>
  60. }