版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

74 regels
2.2 KiB

  1. import { HKT2, Kind2, Kind3, Kind4, URIS2, URIS3, URIS4 } from './HKT'
  2. import { These } from './These'
  3. /**
  4. * @category model
  5. * @since 2.11.0
  6. */
  7. export interface FromThese<F> {
  8. readonly URI: F
  9. readonly fromThese: <E, A>(e: These<E, A>) => HKT2<F, E, A>
  10. }
  11. /**
  12. * @category model
  13. * @since 2.11.0
  14. */
  15. export interface FromThese2<F extends URIS2> {
  16. readonly URI: F
  17. readonly fromThese: <E, A>(fa: These<E, A>) => Kind2<F, E, A>
  18. }
  19. /**
  20. * @category model
  21. * @since 2.11.0
  22. */
  23. export interface FromThese2C<F extends URIS2, E> {
  24. readonly URI: F
  25. readonly _E: E
  26. readonly fromThese: <A>(fa: These<E, A>) => Kind2<F, E, A>
  27. }
  28. /**
  29. * @category model
  30. * @since 2.11.0
  31. */
  32. export interface FromThese3<F extends URIS3> {
  33. readonly URI: F
  34. readonly fromThese: <E, A, R>(fa: These<E, A>) => Kind3<F, R, E, A>
  35. }
  36. /**
  37. * @category model
  38. * @since 2.11.0
  39. */
  40. export interface FromThese3C<F extends URIS3, E> {
  41. readonly URI: F
  42. readonly _E: E
  43. readonly fromThese: <A, R>(fa: These<E, A>) => Kind3<F, R, E, A>
  44. }
  45. /**
  46. * @category model
  47. * @since 2.11.0
  48. */
  49. export interface FromThese4<F extends URIS4> {
  50. readonly URI: F
  51. readonly fromThese: <E, A, S, R>(fa: These<E, A>) => Kind4<F, S, R, E, A>
  52. }
  53. /**
  54. * @since 2.11.0
  55. */
  56. export declare function fromTheseK<F extends URIS4>(
  57. F: FromThese4<F>
  58. ): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => These<E, B>) => <S, R>(...a: A) => Kind4<F, S, R, E, B>
  59. export declare function fromTheseK<F extends URIS3>(
  60. F: FromThese3<F>
  61. ): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => These<E, B>) => <R>(...a: A) => Kind3<F, R, E, B>
  62. export declare function fromTheseK<F extends URIS3, E>(
  63. F: FromThese3C<F, E>
  64. ): <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => These<E, B>) => <R>(...a: A) => Kind3<F, R, E, B>
  65. export declare function fromTheseK<F extends URIS2>(
  66. F: FromThese2<F>
  67. ): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => These<E, B>) => (...a: A) => Kind2<F, E, B>
  68. export declare function fromTheseK<F extends URIS2, E>(
  69. F: FromThese2C<F, E>
  70. ): <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => These<E, B>) => (...a: A) => Kind2<F, E, B>
  71. export declare function fromTheseK<F>(
  72. F: FromThese<F>
  73. ): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => These<E, B>) => (...a: A) => HKT2<F, E, B>