/** * @since 2.4.0 */ import { Applicative2C } from './Applicative' import { Apply1, Apply2C } from './Apply' import { Bifunctor2 } from './Bifunctor' import { Chain2C } from './Chain' import { Either } from './Either' import { FromEither2 } from './FromEither' import { FromIO2 } from './FromIO' import { FromTask2 } from './FromTask' import { FromThese2 } from './FromThese' import { Lazy } from './function' import { Functor2 } from './Functor' import { IO } from './IO' import { IOEither } from './IOEither' import { Monad2C } from './Monad' import { MonadTask2C } from './MonadTask' import { Option } from './Option' import { Pointed2 } from './Pointed' import { Predicate } from './Predicate' import { ReadonlyNonEmptyArray } from './ReadonlyNonEmptyArray' import { Refinement } from './Refinement' import { Semigroup } from './Semigroup' import * as T from './Task' import * as TH from './These' import These = TH.These import Task = T.Task /** * @category model * @since 2.4.0 */ export interface TaskThese extends Task> {} /** * @category constructors * @since 2.4.0 */ export declare const left: (e: E) => TaskThese /** * @category constructors * @since 2.4.0 */ export declare const right: (a: A) => TaskThese /** * @category constructors * @since 2.4.0 */ export declare const both: (e: E, a: A) => TaskThese /** * @category constructors * @since 2.4.0 */ export declare const rightTask: (ma: Task) => TaskThese /** * @category constructors * @since 2.4.0 */ export declare const leftTask: (me: Task) => TaskThese /** * @category constructors * @since 2.4.0 */ export declare const rightIO: (ma: IO) => TaskThese /** * @category constructors * @since 2.4.0 */ export declare const leftIO: (me: IO) => TaskThese /** * @category conversions * @since 2.10.0 */ export declare const fromEither: (fa: Either) => TaskThese /** * @category conversions * @since 2.11.0 */ export declare const fromThese: (fa: These) => TaskThese /** * @category conversions * @since 2.7.0 */ export declare const fromIO: (fa: IO) => TaskThese /** * @category conversions * @since 2.4.0 */ export declare const fromIOEither: (fa: IOEither) => TaskThese /** * @category conversions * @since 2.7.0 */ export declare const fromTask: (fa: Task) => TaskThese /** * @category pattern matching * @since 2.10.0 */ export declare const match: ( onLeft: (e: E) => B, onRight: (a: A) => B, onBoth: (e: E, a: A) => B ) => (fa: TaskThese) => Task /** * Less strict version of [`match`](#match). * * The `W` suffix (short for **W**idening) means that the handler return types will be merged. * * @category pattern matching * @since 2.10.0 */ export declare const matchW: ( onLeft: (e: E) => B, onRight: (a: A) => C, onBoth: (e: E, a: A) => D ) => (ma: TaskThese) => T.Task /** * The `E` suffix (short for **E**ffect) means that the handlers return an effect (`Task`). * * @category pattern matching * @since 2.10.0 */ export declare const matchE: ( onLeft: (e: E) => Task, onRight: (a: A) => Task, onBoth: (e: E, a: A) => Task ) => (fa: TaskThese) => Task /** * Alias of [`matchE`](#matche). * * @category pattern matching * @since 2.4.0 */ export declare const fold: ( onLeft: (e: E) => T.Task, onRight: (a: A) => T.Task, onBoth: (e: E, a: A) => T.Task ) => (fa: TaskThese) => T.Task /** * Less strict version of [`matchE`](#matche). * * The `W` suffix (short for **W**idening) means that the handler return types will be merged. * * @category pattern matching * @since 2.10.0 */ export declare const matchEW: ( onLeft: (e: E) => Task, onRight: (a: A) => Task, onBoth: (e: E, a: A) => Task ) => (fa: TaskThese) => Task /** * Alias of [`matchEW`](#matchew). * * @category pattern matching * @since 2.10.0 */ export declare const foldW: ( onLeft: (e: E) => T.Task, onRight: (a: A) => T.Task, onBoth: (e: E, a: A) => T.Task ) => (fa: TaskThese) => T.Task /** * @since 2.4.0 */ export declare const swap: (fa: TaskThese) => TaskThese /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category mapping * @since 2.4.0 */ export declare const map: (f: (a: A) => B) => (fa: TaskThese) => TaskThese /** * Map a pair of functions over the two type arguments of the bifunctor. * * @category mapping * @since 2.4.0 */ export declare const bimap: (f: (e: E) => G, g: (a: A) => B) => (fa: TaskThese) => TaskThese /** * Map a function over the first type argument of a bifunctor. * * @category error handling * @since 2.4.0 */ export declare const mapLeft: (f: (e: E) => G) => (fa: TaskThese) => TaskThese /** * @category constructors * @since 2.7.0 */ export declare const of: (a: A) => TaskThese /** * @category type lambdas * @since 2.4.0 */ export declare const URI = 'TaskThese' /** * @category type lambdas * @since 2.4.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind2 { readonly [URI]: TaskThese } } /** * @category instances * @since 2.10.0 */ export declare const getApply: (A: Apply1, S: Semigroup) => Apply2C<'TaskThese', E> /** * @category instances * @since 2.7.0 */ export declare function getApplicative(A: Apply1, S: Semigroup): Applicative2C /** * @category instances * @since 2.10.0 */ export declare function getChain(S: Semigroup): Chain2C /** * @category instances * @since 2.4.0 */ export declare function getMonad(S: Semigroup): Monad2C & MonadTask2C /** * @category instances * @since 2.10.0 */ export declare const Functor: Functor2 /** * @category mapping * @since 2.10.0 */ export declare const flap: (a: A) => (fab: TaskThese B>) => TaskThese /** * @category instances * @since 2.10.0 */ export declare const Pointed: Pointed2 /** * @category instances * @since 2.10.0 */ export declare const Bifunctor: Bifunctor2 /** * @category instances * @since 2.10.0 */ export declare const FromEither: FromEither2 /** * @category conversions * @since 2.10.0 */ export declare const fromOption: (onNone: Lazy) => (fa: Option) => TaskThese /** * @category lifting * @since 2.10.0 */ export declare const fromOptionK: ( onNone: Lazy ) => , B>(f: (...a: A) => Option) => (...a: A) => TaskThese /** * @category lifting * @since 2.10.0 */ export declare const fromPredicate: { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => TaskThese (predicate: Predicate, onFalse: (a: A) => E): (b: B) => TaskThese (predicate: Predicate, onFalse: (a: A) => E): (a: A) => TaskThese } /** * @category instances * @since 2.11.0 */ export declare const FromThese: FromThese2 /** * @category lifting * @since 2.11.0 */ export declare const fromTheseK: , E, B>( f: (...a: A) => TH.These ) => (...a: A) => TaskThese /** * @category instances * @since 2.10.0 */ export declare const FromIO: FromIO2 /** * @category lifting * @since 2.10.0 */ export declare const fromIOK: , B>( f: (...a: A) => IO ) => (...a: A) => TaskThese /** * @category instances * @since 2.10.0 */ export declare const FromTask: FromTask2 /** * @category lifting * @since 2.10.0 */ export declare const fromTaskK: , B>( f: (...a: A) => T.Task ) => (...a: A) => TaskThese /** * @since 2.10.0 */ export declare const toTuple2: (e: Lazy, a: Lazy) => (fa: TaskThese) => Task /** * @since 2.11.0 */ export declare const ApT: TaskThese /** * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(getApplicative(T.ApplicativePar, S))`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyNonEmptyArrayWithIndex: ( S: Semigroup ) => ( f: (index: number, a: A) => TaskThese ) => (as: ReadonlyNonEmptyArray) => TaskThese> /** * Equivalent to `ReadonlyArray#traverseWithIndex(getApplicative(T.ApplicativePar, S))`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyArrayWithIndex: ( S: Semigroup ) => (f: (index: number, a: A) => TaskThese) => (as: readonly A[]) => TaskThese /** * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(getApplicative(T.ApplicativeSeq, S))`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyNonEmptyArrayWithIndexSeq: ( S: Semigroup ) => ( f: (index: number, a: A) => TaskThese ) => (as: ReadonlyNonEmptyArray) => TaskThese> /** * Equivalent to `ReadonlyArray#traverseWithIndex(getApplicative(T.ApplicativeSeq, S))`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyArrayWithIndexSeq: ( S: Semigroup ) => (f: (index: number, a: A) => TaskThese) => (as: readonly A[]) => TaskThese /** * Use [`Functor`](#functor) instead. * * @category zone of death * @since 2.7.0 * @deprecated */ export declare const functorTaskThese: Functor2 /** * Use [`Bifunctor`](#bifunctor) instead. * * @category zone of death * @since 2.7.0 * @deprecated */ export declare const bifunctorTaskThese: Bifunctor2 /** * Use [`toTuple2`](#totuple2) instead. * * @category zone of death * @since 2.4.0 * @deprecated */ export declare const toTuple: (e: E, a: A) => (fa: TaskThese) => T.Task<[E, A]> /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `TT.Functor` instead of `TT.taskThese` * (where `TT` is from `import TT from 'fp-ts/TaskThese'`) * * @category zone of death * @since 2.4.0 * @deprecated */ export declare const taskThese: Functor2 & Bifunctor2 /** * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead. * * @category zone of death * @since 2.4.0 * @deprecated */ export declare const getSemigroup: (SE: Semigroup, SA: Semigroup) => Semigroup>