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

84 wiersze
2.1 KiB

  1. /**
  2. * @since 2.11.0
  3. */
  4. import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT'
  5. import { Pointed, Pointed1, Pointed2, Pointed2C, Pointed3, Pointed3C, Pointed4 } from './Pointed'
  6. /**
  7. * @category model
  8. * @since 2.11.0
  9. */
  10. export interface Zero<F> {
  11. readonly URI: F
  12. readonly zero: <A>() => HKT<F, A>
  13. }
  14. /**
  15. * @category model
  16. * @since 2.11.0
  17. */
  18. export interface Zero1<F extends URIS> {
  19. readonly URI: F
  20. readonly zero: <A>() => Kind<F, A>
  21. }
  22. /**
  23. * @category model
  24. * @since 2.11.0
  25. */
  26. export interface Zero2<F extends URIS2> {
  27. readonly URI: F
  28. readonly zero: <E, A>() => Kind2<F, E, A>
  29. }
  30. /**
  31. * @category model
  32. * @since 2.11.0
  33. */
  34. export interface Zero2C<F extends URIS2, E> {
  35. readonly URI: F
  36. readonly _E: E
  37. readonly zero: <A>() => Kind2<F, E, A>
  38. }
  39. /**
  40. * @category model
  41. * @since 2.11.0
  42. */
  43. export interface Zero3<F extends URIS3> {
  44. readonly URI: F
  45. readonly zero: <R, E, A>() => Kind3<F, R, E, A>
  46. }
  47. /**
  48. * @category model
  49. * @since 2.11.0
  50. */
  51. export interface Zero3C<F extends URIS3, E> {
  52. readonly URI: F
  53. readonly _E: E
  54. readonly zero: <R, A>() => Kind3<F, R, E, A>
  55. }
  56. /**
  57. * @category model
  58. * @since 2.11.0
  59. */
  60. export interface Zero4<F extends URIS4> {
  61. readonly URI: F
  62. readonly zero: <S, R, E, A>() => Kind4<F, S, R, E, A>
  63. }
  64. /**
  65. * @category do notation
  66. * @since 2.11.0
  67. */
  68. export declare function guard<F extends URIS4>(
  69. F: Zero4<F>,
  70. P: Pointed4<F>
  71. ): <S, R, E>(b: boolean) => Kind4<F, S, R, E, void>
  72. export declare function guard<F extends URIS3>(F: Zero3<F>, P: Pointed3<F>): <R, E>(b: boolean) => Kind3<F, R, E, void>
  73. export declare function guard<F extends URIS3, E>(
  74. F: Zero3C<F, E>,
  75. P: Pointed3C<F, E>
  76. ): <R>(b: boolean) => Kind3<F, R, E, void>
  77. export declare function guard<F extends URIS2>(F: Zero2<F>, P: Pointed2<F>): <E>(b: boolean) => Kind2<F, E, void>
  78. export declare function guard<F extends URIS2, E>(
  79. F: Zero2C<F, E>,
  80. P: Pointed2C<F, E>
  81. ): (b: boolean) => Kind2<F, E, void>
  82. export declare function guard<F extends URIS>(F: Zero1<F>, P: Pointed1<F>): (b: boolean) => Kind<F, void>
  83. export declare function guard<F>(F: Zero<F>, P: Pointed<F>): (b: boolean) => HKT<F, void>