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

55 lines
1.3 KiB

  1. /**
  2. * @since 2.0.0
  3. */
  4. import { Extend, Extend1, Extend2, Extend2C, Extend3, Extend3C, Extend4 } from './Extend'
  5. import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT'
  6. /**
  7. * @category model
  8. * @since 2.0.0
  9. */
  10. export interface Comonad<W> extends Extend<W> {
  11. readonly extract: <A>(wa: HKT<W, A>) => A
  12. }
  13. /**
  14. * @category model
  15. * @since 2.0.0
  16. */
  17. export interface Comonad1<W extends URIS> extends Extend1<W> {
  18. readonly extract: <A>(wa: Kind<W, A>) => A
  19. }
  20. /**
  21. * @category model
  22. * @since 2.0.0
  23. */
  24. export interface Comonad2<W extends URIS2> extends Extend2<W> {
  25. readonly extract: <E, A>(wa: Kind2<W, E, A>) => A
  26. }
  27. /**
  28. * @category model
  29. * @since 2.0.0
  30. */
  31. export interface Comonad2C<W extends URIS2, E> extends Extend2C<W, E> {
  32. readonly extract: <A>(wa: Kind2<W, E, A>) => A
  33. }
  34. /**
  35. * @category model
  36. * @since 2.0.0
  37. */
  38. export interface Comonad3<W extends URIS3> extends Extend3<W> {
  39. readonly extract: <R, E, A>(wa: Kind3<W, R, E, A>) => A
  40. }
  41. /**
  42. * @category model
  43. * @since 2.10.0
  44. */
  45. export interface Comonad3C<W extends URIS3, E> extends Extend3C<W, E> {
  46. readonly extract: <R, A>(wa: Kind3<W, R, E, A>) => A
  47. }
  48. /**
  49. * @category model
  50. * @since 2.10.0
  51. */
  52. export interface Comonad4<W extends URIS4> extends Extend4<W> {
  53. readonly extract: <S, R, E, A>(wa: Kind4<W, S, R, E, A>) => A
  54. }