版博士V2.0程序
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

TaskEither.d.ts 33 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. /**
  2. * ```ts
  3. * interface TaskEither<E, A> extends Task<Either<E, A>> {}
  4. * ```
  5. *
  6. * `TaskEither<E, A>` represents an asynchronous computation that either yields a value of type `A` or fails yielding an
  7. * error of type `E`. If you want to represent an asynchronous computation that never fails, please see `Task`.
  8. *
  9. * @since 2.0.0
  10. */
  11. import { Alt2, Alt2C } from './Alt'
  12. import { Applicative2, Applicative2C } from './Applicative'
  13. import { Apply1, Apply2 } from './Apply'
  14. import { Bifunctor2 } from './Bifunctor'
  15. import { Chain2 } from './Chain'
  16. import { Compactable2C } from './Compactable'
  17. import * as E from './Either'
  18. import { Filterable2C } from './Filterable'
  19. import { FromEither2 } from './FromEither'
  20. import { FromIO2 } from './FromIO'
  21. import { FromTask2 } from './FromTask'
  22. import { Lazy } from './function'
  23. import { Functor2 } from './Functor'
  24. import { IO } from './IO'
  25. import { IOEither } from './IOEither'
  26. import { Monad2, Monad2C } from './Monad'
  27. import { MonadIO2 } from './MonadIO'
  28. import { MonadTask2, MonadTask2C } from './MonadTask'
  29. import { MonadThrow2, MonadThrow2C } from './MonadThrow'
  30. import { Monoid } from './Monoid'
  31. import { Option } from './Option'
  32. import { Pointed2 } from './Pointed'
  33. import { Predicate } from './Predicate'
  34. import { ReadonlyNonEmptyArray } from './ReadonlyNonEmptyArray'
  35. import { Refinement } from './Refinement'
  36. import { Semigroup } from './Semigroup'
  37. import * as T from './Task'
  38. import { TaskOption } from './TaskOption'
  39. import Either = E.Either
  40. import Task = T.Task
  41. /**
  42. * @category model
  43. * @since 2.0.0
  44. */
  45. export interface TaskEither<E, A> extends Task<Either<E, A>> {}
  46. /**
  47. * @category constructors
  48. * @since 2.0.0
  49. */
  50. export declare const left: <E = never, A = never>(e: E) => TaskEither<E, A>
  51. /**
  52. * @category constructors
  53. * @since 2.0.0
  54. */
  55. export declare const right: <E = never, A = never>(a: A) => TaskEither<E, A>
  56. /**
  57. * @category constructors
  58. * @since 2.0.0
  59. */
  60. export declare const rightTask: <E = never, A = never>(ma: Task<A>) => TaskEither<E, A>
  61. /**
  62. * @category constructors
  63. * @since 2.0.0
  64. */
  65. export declare const leftTask: <E = never, A = never>(me: Task<E>) => TaskEither<E, A>
  66. /**
  67. * @category constructors
  68. * @since 2.0.0
  69. */
  70. export declare const rightIO: <E = never, A = never>(ma: IO<A>) => TaskEither<E, A>
  71. /**
  72. * @category constructors
  73. * @since 2.0.0
  74. */
  75. export declare const leftIO: <E = never, A = never>(me: IO<E>) => TaskEither<E, A>
  76. /**
  77. * @category conversions
  78. * @since 2.7.0
  79. */
  80. export declare const fromIO: <A, E = never>(fa: IO<A>) => TaskEither<E, A>
  81. /**
  82. * @category conversions
  83. * @since 2.7.0
  84. */
  85. export declare const fromTask: <A, E = never>(fa: Task<A>) => TaskEither<E, A>
  86. /**
  87. * @category conversions
  88. * @since 2.0.0
  89. */
  90. export declare const fromEither: <E, A>(fa: Either<E, A>) => TaskEither<E, A>
  91. /**
  92. * @category conversions
  93. * @since 2.0.0
  94. */
  95. export declare const fromIOEither: <E, A>(fa: IOEither<E, A>) => TaskEither<E, A>
  96. /**
  97. * @category conversions
  98. * @since 2.11.0
  99. */
  100. export declare const fromTaskOption: <E>(onNone: Lazy<E>) => <A>(fa: TaskOption<A>) => TaskEither<E, A>
  101. /**
  102. * @category pattern matching
  103. * @since 2.10.0
  104. */
  105. export declare const match: <E, B, A>(onLeft: (e: E) => B, onRight: (a: A) => B) => (ma: TaskEither<E, A>) => Task<B>
  106. /**
  107. * Less strict version of [`match`](#match).
  108. *
  109. * The `W` suffix (short for **W**idening) means that the handler return types will be merged.
  110. *
  111. * @category pattern matching
  112. * @since 2.10.0
  113. */
  114. export declare const matchW: <E, B, A, C>(
  115. onLeft: (e: E) => B,
  116. onRight: (a: A) => C
  117. ) => (ma: TaskEither<E, A>) => Task<B | C>
  118. /**
  119. * The `E` suffix (short for **E**ffect) means that the handlers return an effect (`Task`).
  120. *
  121. * @category pattern matching
  122. * @since 2.10.0
  123. */
  124. export declare const matchE: <E, A, B>(
  125. onLeft: (e: E) => Task<B>,
  126. onRight: (a: A) => Task<B>
  127. ) => (ma: TaskEither<E, A>) => Task<B>
  128. /**
  129. * Alias of [`matchE`](#matche).
  130. *
  131. * @category pattern matching
  132. * @since 2.0.0
  133. */
  134. export declare const fold: <E, A, B>(
  135. onLeft: (e: E) => T.Task<B>,
  136. onRight: (a: A) => T.Task<B>
  137. ) => (ma: TaskEither<E, A>) => T.Task<B>
  138. /**
  139. * Less strict version of [`matchE`](#matche).
  140. *
  141. * The `W` suffix (short for **W**idening) means that the handler return types will be merged.
  142. *
  143. * @category pattern matching
  144. * @since 2.10.0
  145. */
  146. export declare const matchEW: <E, B, A, C>(
  147. onLeft: (e: E) => Task<B>,
  148. onRight: (a: A) => Task<C>
  149. ) => (ma: TaskEither<E, A>) => Task<B | C>
  150. /**
  151. * Alias of [`matchEW`](#matchew).
  152. *
  153. * @category pattern matching
  154. * @since 2.10.0
  155. */
  156. export declare const foldW: <E, B, A, C>(
  157. onLeft: (e: E) => T.Task<B>,
  158. onRight: (a: A) => T.Task<C>
  159. ) => (ma: TaskEither<E, A>) => T.Task<B | C>
  160. /**
  161. * @category error handling
  162. * @since 2.0.0
  163. */
  164. export declare const getOrElse: <E, A>(onLeft: (e: E) => Task<A>) => (ma: TaskEither<E, A>) => Task<A>
  165. /**
  166. * Less strict version of [`getOrElse`](#getorelse).
  167. *
  168. * The `W` suffix (short for **W**idening) means that the handler return type will be merged.
  169. *
  170. * @category error handling
  171. * @since 2.6.0
  172. */
  173. export declare const getOrElseW: <E, B>(onLeft: (e: E) => Task<B>) => <A>(ma: TaskEither<E, A>) => Task<A | B>
  174. /**
  175. * Transforms a `Promise` that may reject to a `Promise` that never rejects and returns an `Either` instead.
  176. *
  177. * See also [`tryCatchK`](#trycatchk).
  178. *
  179. * @example
  180. * import { left, right } from 'fp-ts/Either'
  181. * import { tryCatch } from 'fp-ts/TaskEither'
  182. *
  183. * tryCatch(() => Promise.resolve(1), String)().then(result => {
  184. * assert.deepStrictEqual(result, right(1))
  185. * })
  186. * tryCatch(() => Promise.reject('error'), String)().then(result => {
  187. * assert.deepStrictEqual(result, left('error'))
  188. * })
  189. *
  190. * @category interop
  191. * @since 2.0.0
  192. */
  193. export declare const tryCatch: <E, A>(f: Lazy<Promise<A>>, onRejected: (reason: unknown) => E) => TaskEither<E, A>
  194. /**
  195. * Converts a function returning a `Promise` to one returning a `TaskEither`.
  196. *
  197. * @category interop
  198. * @since 2.5.0
  199. */
  200. export declare const tryCatchK: <E, A extends readonly unknown[], B>(
  201. f: (...a: A) => Promise<B>,
  202. onRejected: (reason: unknown) => E
  203. ) => (...a: A) => TaskEither<E, B>
  204. /**
  205. * @category conversions
  206. * @since 2.10.0
  207. */
  208. export declare const toUnion: <E, A>(fa: TaskEither<E, A>) => Task<E | A>
  209. /**
  210. * @category conversions
  211. * @since 2.12.0
  212. */
  213. export declare const fromNullable: <E>(e: E) => <A>(a: A) => TaskEither<E, NonNullable<A>>
  214. /**
  215. * @category lifting
  216. * @since 2.12.0
  217. */
  218. export declare const fromNullableK: <E>(
  219. e: E
  220. ) => <A extends ReadonlyArray<unknown>, B>(
  221. f: (...a: A) => B | null | undefined
  222. ) => (...a: A) => TaskEither<E, NonNullable<B>>
  223. /**
  224. * @category sequencing
  225. * @since 2.12.0
  226. */
  227. export declare const chainNullableK: <E>(
  228. e: E
  229. ) => <A, B>(f: (a: A) => B | null | undefined) => (ma: TaskEither<E, A>) => TaskEither<E, NonNullable<B>>
  230. /**
  231. * Returns `ma` if is a `Right` or the value returned by `onLeft` otherwise.
  232. *
  233. * See also [alt](#alt).
  234. *
  235. * @example
  236. * import * as E from 'fp-ts/Either'
  237. * import { pipe } from 'fp-ts/function'
  238. * import * as TE from 'fp-ts/TaskEither'
  239. *
  240. * async function test() {
  241. * const errorHandler = TE.orElse((error: string) => TE.right(`recovering from ${error}...`))
  242. * assert.deepStrictEqual(await pipe(TE.right('ok'), errorHandler)(), E.right('ok'))
  243. * assert.deepStrictEqual(await pipe(TE.left('ko'), errorHandler)(), E.right('recovering from ko...'))
  244. * }
  245. *
  246. * test()
  247. *
  248. * @category error handling
  249. * @since 2.0.0
  250. */
  251. export declare const orElse: <E1, A, E2>(
  252. onLeft: (e: E1) => TaskEither<E2, A>
  253. ) => (ma: TaskEither<E1, A>) => TaskEither<E2, A>
  254. /**
  255. * Less strict version of [`orElse`](#orelse).
  256. *
  257. * The `W` suffix (short for **W**idening) means that the return types will be merged.
  258. *
  259. * @category error handling
  260. * @since 2.10.0
  261. */
  262. export declare const orElseW: <E1, E2, B>(
  263. onLeft: (e: E1) => TaskEither<E2, B>
  264. ) => <A>(ma: TaskEither<E1, A>) => TaskEither<E2, A | B>
  265. /**
  266. * @category error handling
  267. * @since 2.11.0
  268. */
  269. export declare const orElseFirst: <E, B>(
  270. onLeft: (e: E) => TaskEither<E, B>
  271. ) => <A>(ma: TaskEither<E, A>) => TaskEither<E, A>
  272. /**
  273. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  274. *
  275. * @category error handling
  276. * @since 2.11.0
  277. */
  278. export declare const orElseFirstW: <E1, E2, B>(
  279. onLeft: (e: E1) => TaskEither<E2, B>
  280. ) => <A>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, A>
  281. /**
  282. * @category error handling
  283. * @since 2.12.0
  284. */
  285. export declare const orElseFirstIOK: <E, B>(onLeft: (e: E) => IO<B>) => <A>(ma: TaskEither<E, A>) => TaskEither<E, A>
  286. /**
  287. * @category error handling
  288. * @since 2.12.0
  289. */
  290. export declare const orElseFirstTaskK: <E, B>(
  291. onLeft: (e: E) => Task<B>
  292. ) => <A>(ma: TaskEither<E, A>) => TaskEither<E, A>
  293. /**
  294. * @category error handling
  295. * @since 2.11.0
  296. */
  297. export declare const orLeft: <E1, E2>(onLeft: (e: E1) => Task<E2>) => <A>(fa: TaskEither<E1, A>) => TaskEither<E2, A>
  298. /**
  299. * @since 2.0.0
  300. */
  301. export declare const swap: <E, A>(ma: TaskEither<E, A>) => TaskEither<A, E>
  302. /**
  303. * @category lifting
  304. * @since 2.11.0
  305. */
  306. export declare const fromTaskOptionK: <E>(
  307. onNone: Lazy<E>
  308. ) => <A extends readonly unknown[], B>(f: (...a: A) => TaskOption<B>) => (...a: A) => TaskEither<E, B>
  309. /**
  310. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  311. *
  312. * @category sequencing
  313. * @since 2.12.3
  314. */
  315. export declare const chainTaskOptionKW: <E2>(
  316. onNone: Lazy<E2>
  317. ) => <A, B>(f: (a: A) => TaskOption<B>) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E2 | E1, B>
  318. /**
  319. * @category sequencing
  320. * @since 2.11.0
  321. */
  322. export declare const chainTaskOptionK: <E>(
  323. onNone: Lazy<E>
  324. ) => <A, B>(f: (a: A) => TaskOption<B>) => (ma: TaskEither<E, A>) => TaskEither<E, B>
  325. /**
  326. * @category lifting
  327. * @since 2.4.0
  328. */
  329. export declare const fromIOEitherK: <E, A extends readonly unknown[], B>(
  330. f: (...a: A) => IOEither<E, B>
  331. ) => (...a: A) => TaskEither<E, B>
  332. /**
  333. * Less strict version of [`chainIOEitherK`](#chainioeitherk).
  334. *
  335. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  336. *
  337. * @category sequencing
  338. * @since 2.6.1
  339. */
  340. export declare const chainIOEitherKW: <E2, A, B>(
  341. f: (a: A) => IOEither<E2, B>
  342. ) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, B>
  343. /**
  344. * @category sequencing
  345. * @since 2.4.0
  346. */
  347. export declare const chainIOEitherK: <E, A, B>(
  348. f: (a: A) => IOEither<E, B>
  349. ) => (ma: TaskEither<E, A>) => TaskEither<E, B>
  350. /**
  351. * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F<A>) => F<B>` whose argument and return types
  352. * use the type constructor `F` to represent some computational context.
  353. *
  354. * @category mapping
  355. * @since 2.0.0
  356. */
  357. export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: TaskEither<E, A>) => TaskEither<E, B>
  358. /**
  359. * Map a pair of functions over the two type arguments of the bifunctor.
  360. *
  361. * @category mapping
  362. * @since 2.0.0
  363. */
  364. export declare const bimap: <E, G, A, B>(f: (e: E) => G, g: (a: A) => B) => (fa: TaskEither<E, A>) => TaskEither<G, B>
  365. /**
  366. * Map a function over the first type argument of a bifunctor.
  367. *
  368. * @category error handling
  369. * @since 2.0.0
  370. */
  371. export declare const mapLeft: <E, G>(f: (e: E) => G) => <A>(fa: TaskEither<E, A>) => TaskEither<G, A>
  372. /**
  373. * @since 2.0.0
  374. */
  375. export declare const ap: <E, A>(fa: TaskEither<E, A>) => <B>(fab: TaskEither<E, (a: A) => B>) => TaskEither<E, B>
  376. /**
  377. * Less strict version of [`ap`](#ap).
  378. *
  379. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  380. *
  381. * @since 2.8.0
  382. */
  383. export declare const apW: <E2, A>(
  384. fa: TaskEither<E2, A>
  385. ) => <E1, B>(fab: TaskEither<E1, (a: A) => B>) => TaskEither<E1 | E2, B>
  386. /**
  387. * Composes computations in sequence, using the return value of one computation to determine the next computation.
  388. *
  389. * @category sequencing
  390. * @since 2.0.0
  391. */
  392. export declare const chain: <E, A, B>(f: (a: A) => TaskEither<E, B>) => (ma: TaskEither<E, A>) => TaskEither<E, B>
  393. /**
  394. * Less strict version of [`chain`](#chain).
  395. *
  396. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  397. *
  398. * @category sequencing
  399. * @since 2.6.0
  400. */
  401. export declare const chainW: <E2, A, B>(
  402. f: (a: A) => TaskEither<E2, B>
  403. ) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, B>
  404. /**
  405. * Less strict version of [`flatten`](#flatten).
  406. *
  407. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  408. *
  409. * @category sequencing
  410. * @since 2.11.0
  411. */
  412. export declare const flattenW: <E1, E2, A>(mma: TaskEither<E1, TaskEither<E2, A>>) => TaskEither<E1 | E2, A>
  413. /**
  414. * @category sequencing
  415. * @since 2.0.0
  416. */
  417. export declare const flatten: <E, A>(mma: TaskEither<E, TaskEither<E, A>>) => TaskEither<E, A>
  418. /**
  419. * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to
  420. * types of kind `* -> *`.
  421. *
  422. * In case of `TaskEither` returns `fa` if is a `Right` or the value returned by `that` otherwise.
  423. *
  424. * See also [orElse](#orelse).
  425. *
  426. * @example
  427. * import * as E from 'fp-ts/Either'
  428. * import { pipe } from 'fp-ts/function'
  429. * import * as TE from 'fp-ts/TaskEither'
  430. *
  431. * async function test() {
  432. * assert.deepStrictEqual(
  433. * await pipe(
  434. * TE.right(1),
  435. * TE.alt(() => TE.right(2))
  436. * )(),
  437. * E.right(1)
  438. * )
  439. * assert.deepStrictEqual(
  440. * await pipe(
  441. * TE.left('a'),
  442. * TE.alt(() => TE.right(2))
  443. * )(),
  444. * E.right(2)
  445. * )
  446. * assert.deepStrictEqual(
  447. * await pipe(
  448. * TE.left('a'),
  449. * TE.alt(() => TE.left('b'))
  450. * )(),
  451. * E.left('b')
  452. * )
  453. * }
  454. *
  455. * test()
  456. *
  457. * @category error handling
  458. * @since 2.0.0
  459. */
  460. export declare const alt: <E, A>(that: Lazy<TaskEither<E, A>>) => (fa: TaskEither<E, A>) => TaskEither<E, A>
  461. /**
  462. * Less strict version of [`alt`](#alt).
  463. *
  464. * The `W` suffix (short for **W**idening) means that the error and the return types will be merged.
  465. *
  466. * @category error handling
  467. * @since 2.9.0
  468. */
  469. export declare const altW: <E2, B>(
  470. that: Lazy<TaskEither<E2, B>>
  471. ) => <E1, A>(fa: TaskEither<E1, A>) => TaskEither<E2, A | B>
  472. /**
  473. * @category constructors
  474. * @since 2.0.0
  475. */
  476. export declare const of: <E = never, A = never>(a: A) => TaskEither<E, A>
  477. /**
  478. * @since 2.7.0
  479. */
  480. export declare const throwError: MonadThrow2<URI>['throwError']
  481. /**
  482. * @category type lambdas
  483. * @since 2.0.0
  484. */
  485. export declare const URI = 'TaskEither'
  486. /**
  487. * @category type lambdas
  488. * @since 2.0.0
  489. */
  490. export declare type URI = typeof URI
  491. declare module './HKT' {
  492. interface URItoKind2<E, A> {
  493. readonly [URI]: TaskEither<E, A>
  494. }
  495. }
  496. /**
  497. * The default [`ApplicativePar`](#applicativepar) instance returns the first error, if you want to
  498. * get all errors you need to provide a way to concatenate them via a `Semigroup`.
  499. *
  500. * @example
  501. * import * as E from 'fp-ts/Either'
  502. * import { pipe } from 'fp-ts/function'
  503. * import * as RA from 'fp-ts/ReadonlyArray'
  504. * import * as S from 'fp-ts/Semigroup'
  505. * import * as string from 'fp-ts/string'
  506. * import * as T from 'fp-ts/Task'
  507. * import * as TE from 'fp-ts/TaskEither'
  508. *
  509. * interface User {
  510. * readonly id: string
  511. * readonly name: string
  512. * }
  513. *
  514. * const remoteDatabase: ReadonlyArray<User> = [
  515. * { id: 'id1', name: 'John' },
  516. * { id: 'id2', name: 'Mary' },
  517. * { id: 'id3', name: 'Joey' }
  518. * ]
  519. *
  520. * const fetchUser = (id: string): TE.TaskEither<string, User> =>
  521. * pipe(
  522. * remoteDatabase,
  523. * RA.findFirst((user) => user.id === id),
  524. * TE.fromOption(() => `${id} not found`)
  525. * )
  526. *
  527. * async function test() {
  528. * assert.deepStrictEqual(
  529. * await pipe(['id4', 'id5'], RA.traverse(TE.ApplicativePar)(fetchUser))(),
  530. * E.left('id4 not found') // <= first error
  531. * )
  532. *
  533. * const Applicative = TE.getApplicativeTaskValidation(
  534. * T.ApplyPar,
  535. * pipe(string.Semigroup, S.intercalate(', '))
  536. * )
  537. *
  538. * assert.deepStrictEqual(
  539. * await pipe(['id4', 'id5'], RA.traverse(Applicative)(fetchUser))(),
  540. * E.left('id4 not found, id5 not found') // <= all errors
  541. * )
  542. * }
  543. *
  544. * test()
  545. *
  546. * @category error handling
  547. * @since 2.7.0
  548. */
  549. export declare function getApplicativeTaskValidation<E>(A: Apply1<T.URI>, S: Semigroup<E>): Applicative2C<URI, E>
  550. /**
  551. * The default [`Alt`](#alt) instance returns the last error, if you want to
  552. * get all errors you need to provide a way to concatenate them via a `Semigroup`.
  553. *
  554. * See [`getAltValidation`](./Either.ts.html#getaltvalidation).
  555. *
  556. * @category error handling
  557. * @since 2.7.0
  558. */
  559. export declare function getAltTaskValidation<E>(S: Semigroup<E>): Alt2C<URI, E>
  560. /**
  561. * @category filtering
  562. * @since 2.10.0
  563. */
  564. export declare const getCompactable: <E>(M: Monoid<E>) => Compactable2C<'TaskEither', E>
  565. /**
  566. * @category filtering
  567. * @since 2.1.0
  568. */
  569. export declare function getFilterable<E>(M: Monoid<E>): Filterable2C<URI, E>
  570. /**
  571. * @category instances
  572. * @since 2.7.0
  573. */
  574. export declare const Functor: Functor2<URI>
  575. /**
  576. * @category mapping
  577. * @since 2.10.0
  578. */
  579. export declare const flap: <A>(a: A) => <E, B>(fab: TaskEither<E, (a: A) => B>) => TaskEither<E, B>
  580. /**
  581. * @category instances
  582. * @since 2.10.0
  583. */
  584. export declare const Pointed: Pointed2<URI>
  585. /**
  586. * Runs computations in parallel.
  587. *
  588. * @category instances
  589. * @since 2.10.0
  590. */
  591. export declare const ApplyPar: Apply2<URI>
  592. /**
  593. * Combine two effectful actions, keeping only the result of the first.
  594. *
  595. * @since 2.0.0
  596. */
  597. export declare const apFirst: <E, B>(second: TaskEither<E, B>) => <A>(first: TaskEither<E, A>) => TaskEither<E, A>
  598. /**
  599. * Less strict version of [`apFirst`](#apfirst).
  600. *
  601. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  602. *
  603. * @since 2.12.0
  604. */
  605. export declare const apFirstW: <E2, B>(
  606. second: TaskEither<E2, B>
  607. ) => <E1, A>(first: TaskEither<E1, A>) => TaskEither<E1 | E2, A>
  608. /**
  609. * Combine two effectful actions, keeping only the result of the second.
  610. *
  611. * @since 2.0.0
  612. */
  613. export declare const apSecond: <E, B>(second: TaskEither<E, B>) => <A>(first: TaskEither<E, A>) => TaskEither<E, B>
  614. /**
  615. * Less strict version of [`apSecond`](#apsecond).
  616. *
  617. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  618. *
  619. * @since 2.12.0
  620. */
  621. export declare const apSecondW: <E2, B>(
  622. second: TaskEither<E2, B>
  623. ) => <E1, A>(first: TaskEither<E1, A>) => TaskEither<E1 | E2, B>
  624. /**
  625. * Runs computations in parallel.
  626. *
  627. * @category instances
  628. * @since 2.7.0
  629. */
  630. export declare const ApplicativePar: Applicative2<URI>
  631. /**
  632. * Runs computations sequentially.
  633. *
  634. * @category instances
  635. * @since 2.10.0
  636. */
  637. export declare const ApplySeq: Apply2<URI>
  638. /**
  639. * Runs computations sequentially.
  640. *
  641. * @category instances
  642. * @since 2.7.0
  643. */
  644. export declare const ApplicativeSeq: Applicative2<URI>
  645. /**
  646. * @category instances
  647. * @since 2.10.0
  648. */
  649. export declare const Chain: Chain2<URI>
  650. /**
  651. * @category instances
  652. * @since 2.10.0
  653. */
  654. export declare const Monad: Monad2<URI>
  655. /**
  656. * @category instances
  657. * @since 2.10.0
  658. */
  659. export declare const MonadIO: MonadIO2<URI>
  660. /**
  661. * @category instances
  662. * @since 2.10.0
  663. */
  664. export declare const MonadTask: MonadTask2<URI>
  665. /**
  666. * @category instances
  667. * @since 2.10.0
  668. */
  669. export declare const MonadThrow: MonadThrow2<URI>
  670. /**
  671. * Composes computations in sequence, using the return value of one computation to determine the next computation and
  672. * keeping only the result of the first.
  673. *
  674. * @category sequencing
  675. * @since 2.0.0
  676. */
  677. export declare const chainFirst: <E, A, B>(f: (a: A) => TaskEither<E, B>) => (ma: TaskEither<E, A>) => TaskEither<E, A>
  678. /**
  679. * Less strict version of [`chainFirst`](#chainfirst).
  680. *
  681. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  682. *
  683. * @category sequencing
  684. * @since 2.8.0
  685. */
  686. export declare const chainFirstW: <E2, A, B>(
  687. f: (a: A) => TaskEither<E2, B>
  688. ) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, A>
  689. /**
  690. * @category instances
  691. * @since 2.7.0
  692. */
  693. export declare const Bifunctor: Bifunctor2<URI>
  694. /**
  695. * @category instances
  696. * @since 2.7.0
  697. */
  698. export declare const Alt: Alt2<URI>
  699. /**
  700. * @category instances
  701. * @since 2.10.0
  702. */
  703. export declare const FromEither: FromEither2<URI>
  704. /**
  705. * @category conversions
  706. * @since 2.0.0
  707. */
  708. export declare const fromOption: <E>(onNone: Lazy<E>) => <A>(fa: Option<A>) => TaskEither<E, A>
  709. /**
  710. * @category lifting
  711. * @since 2.10.0
  712. */
  713. export declare const fromOptionK: <E>(
  714. onNone: Lazy<E>
  715. ) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => (...a: A) => TaskEither<E, B>
  716. /**
  717. * @category sequencing
  718. * @since 2.10.0
  719. */
  720. export declare const chainOptionK: <E>(
  721. onNone: Lazy<E>
  722. ) => <A, B>(f: (a: A) => Option<B>) => (ma: TaskEither<E, A>) => TaskEither<E, B>
  723. /**
  724. * @category sequencing
  725. * @since 2.4.0
  726. */
  727. export declare const chainEitherK: <E, A, B>(f: (a: A) => E.Either<E, B>) => (ma: TaskEither<E, A>) => TaskEither<E, B>
  728. /**
  729. * Less strict version of [`chainEitherK`](#chaineitherk).
  730. *
  731. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  732. *
  733. * @category sequencing
  734. * @since 2.6.1
  735. */
  736. export declare const chainEitherKW: <E2, A, B>(
  737. f: (a: A) => Either<E2, B>
  738. ) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, B>
  739. /**
  740. * @category sequencing
  741. * @since 2.12.0
  742. */
  743. export declare const chainFirstEitherK: <A, E, B>(
  744. f: (a: A) => E.Either<E, B>
  745. ) => (ma: TaskEither<E, A>) => TaskEither<E, A>
  746. /**
  747. * Less strict version of [`chainFirstEitherK`](#chainfirsteitherk).
  748. *
  749. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  750. *
  751. * @category sequencing
  752. * @since 2.12.0
  753. */
  754. export declare const chainFirstEitherKW: <A, E2, B>(
  755. f: (a: A) => E.Either<E2, B>
  756. ) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, A>
  757. /**
  758. * @category lifting
  759. * @since 2.0.0
  760. */
  761. export declare const fromPredicate: {
  762. <E, A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (a: A) => TaskEither<E, B>
  763. <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(b: B) => TaskEither<E, B>
  764. <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): (a: A) => TaskEither<E, A>
  765. }
  766. /**
  767. * @category filtering
  768. * @since 2.0.0
  769. */
  770. export declare const filterOrElse: {
  771. <E, A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (ma: TaskEither<E, A>) => TaskEither<E, B>
  772. <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(mb: TaskEither<E, B>) => TaskEither<E, B>
  773. <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): (ma: TaskEither<E, A>) => TaskEither<E, A>
  774. }
  775. /**
  776. * Less strict version of [`filterOrElse`](#filterorelse).
  777. *
  778. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  779. *
  780. * @category filtering
  781. * @since 2.9.0
  782. */
  783. export declare const filterOrElseW: {
  784. <A, B extends A, E2>(refinement: Refinement<A, B>, onFalse: (a: A) => E2): <E1>(
  785. ma: TaskEither<E1, A>
  786. ) => TaskEither<E1 | E2, B>
  787. <A, E2>(predicate: Predicate<A>, onFalse: (a: A) => E2): <E1, B extends A>(
  788. mb: TaskEither<E1, B>
  789. ) => TaskEither<E1 | E2, B>
  790. <A, E2>(predicate: Predicate<A>, onFalse: (a: A) => E2): <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, A>
  791. }
  792. /**
  793. * @category lifting
  794. * @since 2.4.0
  795. */
  796. export declare const fromEitherK: <E, A extends ReadonlyArray<unknown>, B>(
  797. f: (...a: A) => E.Either<E, B>
  798. ) => (...a: A) => TaskEither<E, B>
  799. /**
  800. * @category instances
  801. * @since 2.10.0
  802. */
  803. export declare const FromIO: FromIO2<URI>
  804. /**
  805. * @category lifting
  806. * @since 2.10.0
  807. */
  808. export declare const fromIOK: <A extends ReadonlyArray<unknown>, B>(
  809. f: (...a: A) => IO<B>
  810. ) => <E = never>(...a: A) => TaskEither<E, B>
  811. /**
  812. * @category sequencing
  813. * @since 2.10.0
  814. */
  815. export declare const chainIOK: <A, B>(f: (a: A) => IO<B>) => <E>(first: TaskEither<E, A>) => TaskEither<E, B>
  816. /**
  817. * @category sequencing
  818. * @since 2.10.0
  819. */
  820. export declare const chainFirstIOK: <A, B>(f: (a: A) => IO<B>) => <E>(first: TaskEither<E, A>) => TaskEither<E, A>
  821. /**
  822. * @category instances
  823. * @since 2.10.0
  824. */
  825. export declare const FromTask: FromTask2<URI>
  826. /**
  827. * @category lifting
  828. * @since 2.10.0
  829. */
  830. export declare const fromTaskK: <A extends ReadonlyArray<unknown>, B>(
  831. f: (...a: A) => T.Task<B>
  832. ) => <E = never>(...a: A) => TaskEither<E, B>
  833. /**
  834. * @category sequencing
  835. * @since 2.10.0
  836. */
  837. export declare const chainTaskK: <A, B>(f: (a: A) => T.Task<B>) => <E>(first: TaskEither<E, A>) => TaskEither<E, B>
  838. /**
  839. * @category sequencing
  840. * @since 2.10.0
  841. */
  842. export declare const chainFirstTaskK: <A, B>(f: (a: A) => T.Task<B>) => <E>(first: TaskEither<E, A>) => TaskEither<E, A>
  843. /**
  844. * Convert a node style callback function to one returning a `TaskEither`
  845. *
  846. * **Note**. If the function `f` admits multiple overloadings, `taskify` will pick last one. If you want a different
  847. * behaviour, add an explicit type annotation
  848. *
  849. * ```ts
  850. * // readFile admits multiple overloadings
  851. *
  852. * // const readFile: (a: string) => TaskEither<NodeJS.ErrnoException, Buffer>
  853. * const readFile = taskify(fs.readFile)
  854. *
  855. * const readFile2: (filename: string, encoding: string) => TaskEither<NodeJS.ErrnoException, Buffer> = taskify(
  856. * fs.readFile
  857. * )
  858. * ```
  859. *
  860. * @example
  861. * import { taskify } from 'fp-ts/TaskEither'
  862. * import * as fs from 'fs'
  863. *
  864. * // const stat: (a: string | Buffer) => TaskEither<NodeJS.ErrnoException, fs.Stats>
  865. * const stat = taskify(fs.stat)
  866. * assert.strictEqual(stat.length, 0)
  867. *
  868. * @category interop
  869. * @since 2.0.0
  870. */
  871. export declare function taskify<L, R>(f: (cb: (e: L | null | undefined, r?: R) => void) => void): () => TaskEither<L, R>
  872. export declare function taskify<A, L, R>(
  873. f: (a: A, cb: (e: L | null | undefined, r?: R) => void) => void
  874. ): (a: A) => TaskEither<L, R>
  875. export declare function taskify<A, B, L, R>(
  876. f: (a: A, b: B, cb: (e: L | null | undefined, r?: R) => void) => void
  877. ): (a: A, b: B) => TaskEither<L, R>
  878. export declare function taskify<A, B, C, L, R>(
  879. f: (a: A, b: B, c: C, cb: (e: L | null | undefined, r?: R) => void) => void
  880. ): (a: A, b: B, c: C) => TaskEither<L, R>
  881. export declare function taskify<A, B, C, D, L, R>(
  882. f: (a: A, b: B, c: C, d: D, cb: (e: L | null | undefined, r?: R) => void) => void
  883. ): (a: A, b: B, c: C, d: D) => TaskEither<L, R>
  884. export declare function taskify<A, B, C, D, E, L, R>(
  885. f: (a: A, b: B, c: C, d: D, e: E, cb: (e: L | null | undefined, r?: R) => void) => void
  886. ): (a: A, b: B, c: C, d: D, e: E) => TaskEither<L, R>
  887. /**
  888. * Make sure that a resource is cleaned up in the event of an exception (\*). The release action is called regardless of
  889. * whether the body action throws (\*) or returns.
  890. *
  891. * (\*) i.e. returns a `Left`
  892. *
  893. * @since 2.0.0
  894. */
  895. export declare const bracket: <E, A, B>(
  896. acquire: TaskEither<E, A>,
  897. use: (a: A) => TaskEither<E, B>,
  898. release: (a: A, e: E.Either<E, B>) => TaskEither<E, void>
  899. ) => TaskEither<E, B>
  900. /**
  901. * Less strict version of [`bracket`](#bracket).
  902. *
  903. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  904. *
  905. * @since 2.12.0
  906. */
  907. export declare const bracketW: <E1, A, E2, B, E3>(
  908. acquire: TaskEither<E1, A>,
  909. use: (a: A) => TaskEither<E2, B>,
  910. release: (a: A, e: E.Either<E2, B>) => TaskEither<E3, void>
  911. ) => TaskEither<E1 | E2 | E3, B>
  912. /**
  913. * @category do notation
  914. * @since 2.9.0
  915. */
  916. export declare const Do: TaskEither<never, {}>
  917. /**
  918. * @category do notation
  919. * @since 2.8.0
  920. */
  921. export declare const bindTo: <N extends string>(
  922. name: N
  923. ) => <E, A>(fa: TaskEither<E, A>) => TaskEither<E, { readonly [K in N]: A }>
  924. declare const let_: <N extends string, A, B>(
  925. name: Exclude<N, keyof A>,
  926. f: (a: A) => B
  927. ) => <E>(fa: TaskEither<E, A>) => TaskEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
  928. export {
  929. /**
  930. * @category do notation
  931. * @since 2.13.0
  932. */
  933. let_ as let
  934. }
  935. /**
  936. * @category do notation
  937. * @since 2.8.0
  938. */
  939. export declare const bind: <N extends string, A, E, B>(
  940. name: Exclude<N, keyof A>,
  941. f: (a: A) => TaskEither<E, B>
  942. ) => (ma: TaskEither<E, A>) => TaskEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
  943. /**
  944. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  945. *
  946. * @category do notation
  947. * @since 2.8.0
  948. */
  949. export declare const bindW: <N extends string, A, E2, B>(
  950. name: Exclude<N, keyof A>,
  951. f: (a: A) => TaskEither<E2, B>
  952. ) => <E1>(fa: TaskEither<E1, A>) => TaskEither<
  953. E1 | E2,
  954. {
  955. readonly [K in keyof A | N]: K extends keyof A ? A[K] : B
  956. }
  957. >
  958. /**
  959. * @category do notation
  960. * @since 2.8.0
  961. */
  962. export declare const apS: <N extends string, A, E, B>(
  963. name: Exclude<N, keyof A>,
  964. fb: TaskEither<E, B>
  965. ) => (fa: TaskEither<E, A>) => TaskEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
  966. /**
  967. * Less strict version of [`apS`](#aps).
  968. *
  969. * The `W` suffix (short for **W**idening) means that the error types will be merged.
  970. *
  971. * @category do notation
  972. * @since 2.8.0
  973. */
  974. export declare const apSW: <A, N extends string, E2, B>(
  975. name: Exclude<N, keyof A>,
  976. fb: TaskEither<E2, B>
  977. ) => <E1>(fa: TaskEither<E1, A>) => TaskEither<
  978. E1 | E2,
  979. {
  980. readonly [K in keyof A | N]: K extends keyof A ? A[K] : B
  981. }
  982. >
  983. /**
  984. * @since 2.11.0
  985. */
  986. export declare const ApT: TaskEither<never, readonly []>
  987. /**
  988. * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(ApplicativePar)`.
  989. *
  990. * @category traversing
  991. * @since 2.11.0
  992. */
  993. export declare const traverseReadonlyNonEmptyArrayWithIndex: <A, E, B>(
  994. f: (index: number, a: A) => TaskEither<E, B>
  995. ) => (as: ReadonlyNonEmptyArray<A>) => TaskEither<E, ReadonlyNonEmptyArray<B>>
  996. /**
  997. * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativePar)`.
  998. *
  999. * @category traversing
  1000. * @since 2.11.0
  1001. */
  1002. export declare const traverseReadonlyArrayWithIndex: <A, E, B>(
  1003. f: (index: number, a: A) => TaskEither<E, B>
  1004. ) => (as: readonly A[]) => TaskEither<E, readonly B[]>
  1005. /**
  1006. * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativeSeq)`.
  1007. *
  1008. * @category traversing
  1009. * @since 2.11.0
  1010. */
  1011. export declare const traverseReadonlyNonEmptyArrayWithIndexSeq: <A, E, B>(
  1012. f: (index: number, a: A) => TaskEither<E, B>
  1013. ) => (as: ReadonlyNonEmptyArray<A>) => TaskEither<E, ReadonlyNonEmptyArray<B>>
  1014. /**
  1015. * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativeSeq)`.
  1016. *
  1017. * @category traversing
  1018. * @since 2.11.0
  1019. */
  1020. export declare const traverseReadonlyArrayWithIndexSeq: <A, E, B>(
  1021. f: (index: number, a: A) => TaskEither<E, B>
  1022. ) => (as: readonly A[]) => TaskEither<E, readonly B[]>
  1023. /**
  1024. * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
  1025. *
  1026. * @category traversing
  1027. * @since 2.9.0
  1028. */
  1029. export declare const traverseArrayWithIndex: <A, B, E>(
  1030. f: (index: number, a: A) => TaskEither<E, B>
  1031. ) => (as: ReadonlyArray<A>) => TaskEither<E, ReadonlyArray<B>>
  1032. /**
  1033. * Equivalent to `ReadonlyArray#traverse(Applicative)`.
  1034. *
  1035. * @category traversing
  1036. * @since 2.9.0
  1037. */
  1038. export declare const traverseArray: <A, B, E>(
  1039. f: (a: A) => TaskEither<E, B>
  1040. ) => (as: readonly A[]) => TaskEither<E, readonly B[]>
  1041. /**
  1042. * Equivalent to `ReadonlyArray#sequence(Applicative)`.
  1043. *
  1044. * @category traversing
  1045. * @since 2.9.0
  1046. */
  1047. export declare const sequenceArray: <A, E>(arr: ReadonlyArray<TaskEither<E, A>>) => TaskEither<E, ReadonlyArray<A>>
  1048. /**
  1049. * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativeSeq)`.
  1050. *
  1051. * @category traversing
  1052. * @since 2.9.0
  1053. */
  1054. export declare const traverseSeqArrayWithIndex: <A, B, E>(
  1055. f: (index: number, a: A) => TaskEither<E, B>
  1056. ) => (as: ReadonlyArray<A>) => TaskEither<E, ReadonlyArray<B>>
  1057. /**
  1058. * Equivalent to `ReadonlyArray#traverse(ApplicativeSeq)`.
  1059. *
  1060. * @category traversing
  1061. * @since 2.9.0
  1062. */
  1063. export declare const traverseSeqArray: <A, B, E>(
  1064. f: (a: A) => TaskEither<E, B>
  1065. ) => (as: readonly A[]) => TaskEither<E, readonly B[]>
  1066. /**
  1067. * Equivalent to `ReadonlyArray#sequence(ApplicativeSeq)`.
  1068. *
  1069. * @category traversing
  1070. * @since 2.9.0
  1071. */
  1072. export declare const sequenceSeqArray: <A, E>(arr: ReadonlyArray<TaskEither<E, A>>) => TaskEither<E, ReadonlyArray<A>>
  1073. /**
  1074. * This instance is deprecated, use small, specific instances instead.
  1075. * For example if a function needs a `Functor` instance, pass `TE.Functor` instead of `TE.taskEither`
  1076. * (where `TE` is from `import TE from 'fp-ts/TaskEither'`)
  1077. *
  1078. * @category zone of death
  1079. * @since 2.0.0
  1080. * @deprecated
  1081. */
  1082. export declare const taskEither: Monad2<URI> & Bifunctor2<URI> & Alt2<URI> & MonadTask2<URI> & MonadThrow2<URI>
  1083. /**
  1084. * This instance is deprecated, use small, specific instances instead.
  1085. * For example if a function needs a `Functor` instance, pass `TE.Functor` instead of `TE.taskEitherSeq`
  1086. * (where `TE` is from `import TE from 'fp-ts/TaskEither'`)
  1087. *
  1088. * @category zone of death
  1089. * @since 2.0.0
  1090. * @deprecated
  1091. */
  1092. export declare const taskEitherSeq: typeof taskEither
  1093. /**
  1094. * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.
  1095. *
  1096. * @category zone of death
  1097. * @since 2.0.0
  1098. * @deprecated
  1099. */
  1100. export declare const getApplySemigroup: <E, A>(S: Semigroup<A>) => Semigroup<TaskEither<E, A>>
  1101. /**
  1102. * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead.
  1103. *
  1104. * @category zone of death
  1105. * @since 2.0.0
  1106. * @deprecated
  1107. */
  1108. export declare const getApplyMonoid: <E, A>(M: Monoid<A>) => Monoid<TaskEither<E, A>>
  1109. /**
  1110. * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead.
  1111. *
  1112. * @category zone of death
  1113. * @since 2.0.0
  1114. * @deprecated
  1115. */
  1116. export declare const getSemigroup: <E, A>(S: Semigroup<A>) => Semigroup<TaskEither<E, A>>
  1117. /**
  1118. * Use [`getApplicativeTaskValidation`](#getapplicativetaskvalidation) and [`getAltTaskValidation`](#getalttaskvalidation) instead.
  1119. *
  1120. * @category zone of death
  1121. * @since 2.0.0
  1122. * @deprecated
  1123. */
  1124. export declare function getTaskValidation<E>(
  1125. SE: Semigroup<E>
  1126. ): Monad2C<URI, E> & Bifunctor2<URI> & Alt2C<URI, E> & MonadTask2C<URI, E> & MonadThrow2C<URI, E>