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

140 Zeilen
3.5 KiB

  1. /**
  2. * @since 2.2.0
  3. */
  4. import * as BA from './BooleanAlgebra'
  5. import * as E from './Eq'
  6. import { Lazy } from './function'
  7. import { Monoid } from './Monoid'
  8. import * as O from './Ord'
  9. import { Refinement } from './Refinement'
  10. import { Semigroup } from './Semigroup'
  11. import * as S from './Show'
  12. /**
  13. * @category refinements
  14. * @since 2.11.0
  15. */
  16. export declare const isBoolean: Refinement<unknown, boolean>
  17. /**
  18. * Less strict version of [`match`](#match).
  19. *
  20. * The `W` suffix (short for **W**idening) means that the handler return types will be merged.
  21. *
  22. * @category pattern matching
  23. * @since 2.10.0
  24. */
  25. export declare const matchW: <A, B>(onFalse: Lazy<A>, onTrue: Lazy<B>) => (value: boolean) => A | B
  26. /**
  27. * Alias of [`matchW`](#matchw).
  28. *
  29. * @category pattern matching
  30. * @since 2.10.0
  31. */
  32. export declare const foldW: <A, B>(onFalse: Lazy<A>, onTrue: Lazy<B>) => (value: boolean) => A | B
  33. /**
  34. * Defines the fold over a boolean value.
  35. * Takes two thunks `onTrue`, `onFalse` and a `boolean` value.
  36. * If `value` is false, `onFalse()` is returned, otherwise `onTrue()`.
  37. *
  38. * @example
  39. * import { some, map } from 'fp-ts/Option'
  40. * import { pipe } from 'fp-ts/function'
  41. * import { match } from 'fp-ts/boolean'
  42. *
  43. * assert.deepStrictEqual(
  44. * pipe(
  45. * some(true),
  46. * map(match(() => 'false', () => 'true'))
  47. * ),
  48. * some('true')
  49. * )
  50. *
  51. * @category pattern matching
  52. * @since 2.10.0
  53. */
  54. export declare const match: <A>(onFalse: Lazy<A>, onTrue: Lazy<A>) => (value: boolean) => A
  55. /**
  56. * Alias of [`match`](#match).
  57. *
  58. * @category pattern matching
  59. * @since 2.2.0
  60. */
  61. export declare const fold: <A>(onFalse: Lazy<A>, onTrue: Lazy<A>) => (value: boolean) => A
  62. /**
  63. * @category instances
  64. * @since 2.10.0
  65. */
  66. export declare const Eq: E.Eq<boolean>
  67. /**
  68. * @category instances
  69. * @since 2.10.0
  70. */
  71. export declare const BooleanAlgebra: BA.BooleanAlgebra<boolean>
  72. /**
  73. * `boolean` semigroup under conjunction.
  74. *
  75. * @example
  76. * import { SemigroupAll } from 'fp-ts/boolean'
  77. *
  78. * assert.deepStrictEqual(SemigroupAll.concat(true, true), true)
  79. * assert.deepStrictEqual(SemigroupAll.concat(true, false), false)
  80. *
  81. * @category instances
  82. * @since 2.10.0
  83. */
  84. export declare const SemigroupAll: Semigroup<boolean>
  85. /**
  86. * `boolean` semigroup under disjunction.
  87. *
  88. * @example
  89. * import { SemigroupAny } from 'fp-ts/boolean'
  90. *
  91. * assert.deepStrictEqual(SemigroupAny.concat(true, true), true)
  92. * assert.deepStrictEqual(SemigroupAny.concat(true, false), true)
  93. * assert.deepStrictEqual(SemigroupAny.concat(false, false), false)
  94. *
  95. * @category instances
  96. * @since 2.10.0
  97. */
  98. export declare const SemigroupAny: Semigroup<boolean>
  99. /**
  100. * `boolean` monoid under conjunction.
  101. *
  102. * The `empty` value is `true`.
  103. *
  104. * @example
  105. * import { MonoidAll } from 'fp-ts/boolean'
  106. *
  107. * assert.deepStrictEqual(MonoidAll.concat(true, true), true)
  108. * assert.deepStrictEqual(MonoidAll.concat(true, false), false)
  109. *
  110. * @category instances
  111. * @since 2.10.0
  112. */
  113. export declare const MonoidAll: Monoid<boolean>
  114. /**
  115. * `boolean` monoid under disjunction.
  116. *
  117. * The `empty` value is `false`.
  118. *
  119. * @example
  120. * import { MonoidAny } from 'fp-ts/boolean'
  121. *
  122. * assert.deepStrictEqual(MonoidAny.concat(true, true), true)
  123. * assert.deepStrictEqual(MonoidAny.concat(true, false), true)
  124. * assert.deepStrictEqual(MonoidAny.concat(false, false), false)
  125. *
  126. * @category instances
  127. * @since 2.10.0
  128. */
  129. export declare const MonoidAny: Monoid<boolean>
  130. /**
  131. * @category instances
  132. * @since 2.10.0
  133. */
  134. export declare const Ord: O.Ord<boolean>
  135. /**
  136. * @category instances
  137. * @since 2.10.0
  138. */
  139. export declare const Show: S.Show<boolean>