/** * @since 2.13.0 */ import { Applicative2 } from './Applicative' import { Apply2 } from './Apply' import { Chain2 } from './Chain' import { FromIO2 } from './FromIO' import { FromReader2 } from './FromReader' import { Functor2 } from './Functor' import * as I from './IO' import { Monad2 } from './Monad' import { MonadIO2 } from './MonadIO' import { Pointed2 } from './Pointed' import * as R from './Reader' import { Reader } from './Reader' import { IO } from './IO' import { ReadonlyNonEmptyArray } from './ReadonlyNonEmptyArray' /** * @category model * @since 2.13.0 */ export interface ReaderIO { (r: R): I.IO } /** * @category conversions * @since 2.13.0 */ export declare const fromReader: (fa: Reader) => ReaderIO /** * @category conversions * @since 2.13.0 */ export declare const fromIO: (fa: IO) => ReaderIO /** * Changes the value of the local context during the execution of the action `ma` (similar to `Contravariant`'s * `contramap`). * * @since 2.13.0 */ export declare const local: (f: (r2: R2) => R1) => (ma: ReaderIO) => ReaderIO /** * Less strict version of [`asksReaderIO`](#asksreaderio). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category constructors * @since 2.13.0 */ export declare const asksReaderIOW: (f: (r1: R1) => ReaderIO) => ReaderIO /** * Effectfully accesses the environment. * * @category constructors * @since 2.13.0 */ export declare const asksReaderIO: (f: (r: R) => ReaderIO) => ReaderIO /** * `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.13.0 */ export declare const map: (f: (a: A) => B) => (fa: ReaderIO) => ReaderIO /** * @since 2.13.0 */ export declare const ap: (fa: ReaderIO) => (fab: ReaderIO B>) => ReaderIO /** * Less strict version of [`ap`](#ap). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @since 2.13.0 */ export declare const apW: ( fa: ReaderIO ) => (fab: ReaderIO B>) => ReaderIO /** * @category constructors * @since 2.13.0 */ export declare const of: (a: A) => ReaderIO /** * Composes computations in sequence, using the return value of one computation to determine the next computation. * * @category sequencing * @since 2.13.0 */ export declare const chain: (f: (a: A) => ReaderIO) => (ma: ReaderIO) => ReaderIO /** * Less strict version of [`chain`](#chain). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category sequencing * @since 2.13.0 */ export declare const chainW: ( f: (a: A) => ReaderIO ) => (ma: ReaderIO) => ReaderIO /** * Less strict version of [`flatten`](#flatten). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category sequencing * @since 2.13.0 */ export declare const flattenW: (mma: ReaderIO>) => ReaderIO /** * @category sequencing * @since 2.13.0 */ export declare const flatten: (mma: ReaderIO>) => ReaderIO /** * @category type lambdas * @since 2.13.0 */ export declare const URI = 'ReaderIO' /** * @category type lambdas * @since 2.13.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind2 { readonly [URI]: ReaderIO } } /** * @category instances * @since 2.13.0 */ export declare const Functor: Functor2 /** * @category mapping * @since 2.13.0 */ export declare const flap: (a: A) => (fab: ReaderIO B>) => ReaderIO /** * @category instances * @since 2.13.0 */ export declare const Pointed: Pointed2 /** * @category instances * @since 2.13.0 */ export declare const Apply: Apply2 /** * Combine two effectful actions, keeping only the result of the first. * * @since 2.13.0 */ export declare const apFirst: (second: ReaderIO) => (first: ReaderIO) => ReaderIO /** * Combine two effectful actions, keeping only the result of the second. * * @since 2.13.0 */ export declare const apSecond: (second: ReaderIO) => (first: ReaderIO) => ReaderIO /** * @category instances * @since 2.13.0 */ export declare const Applicative: Applicative2 /** * @category instances * @since 2.13.0 */ export declare const Chain: Chain2 /** * @category instances * @since 2.13.0 */ export declare const Monad: Monad2 /** * @category instances * @since 2.13.0 */ export declare const MonadIO: MonadIO2 /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * * @category sequencing * @since 2.13.0 */ export declare const chainFirst: (f: (a: A) => ReaderIO) => (first: ReaderIO) => ReaderIO /** * Less strict version of [`chainFirst`](#chainfirst). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category sequencing * @since 2.13.0 */ export declare const chainFirstW: ( f: (a: A) => ReaderIO ) => (ma: ReaderIO) => ReaderIO /** * @category instances * @since 2.13.0 */ export declare const FromIO: FromIO2 /** * @category lifting * @since 2.13.0 */ export declare const fromIOK: , B>( f: (...a: A) => I.IO ) => (...a: A) => ReaderIO /** * @category sequencing * @since 2.13.0 */ export declare const chainIOK: (f: (a: A) => I.IO) => (first: ReaderIO) => ReaderIO /** * @category sequencing * @since 2.13.0 */ export declare const chainFirstIOK: (f: (a: A) => I.IO) => (first: ReaderIO) => ReaderIO /** * @category instances * @since 2.13.0 */ export declare const FromReader: FromReader2 /** * Reads the current context. * * @category constructors * @since 2.13.0 */ export declare const ask: () => ReaderIO /** * Projects a value from the global context in a `ReaderIO`. * * @category constructors * @since 2.13.0 */ export declare const asks: (f: (r: R) => A) => ReaderIO /** * @category lifting * @since 2.13.0 */ export declare const fromReaderK: , R, B>( f: (...a: A) => R.Reader ) => (...a: A) => ReaderIO /** * @category sequencing * @since 2.13.0 */ export declare const chainReaderK: (f: (a: A) => R.Reader) => (ma: ReaderIO) => ReaderIO /** * Less strict version of [`chainReaderK`](#chainreaderk). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category sequencing * @since 2.13.0 */ export declare const chainReaderKW: ( f: (a: A) => R.Reader ) => (ma: ReaderIO) => ReaderIO /** * @category sequencing * @since 2.13.0 */ export declare const chainFirstReaderK: (f: (a: A) => R.Reader) => (ma: ReaderIO) => ReaderIO /** * Less strict version of [`chainFirstReaderK`](#chainfirstreaderk). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category sequencing * @since 2.13.0 */ export declare const chainFirstReaderKW: ( f: (a: A) => R.Reader ) => (ma: ReaderIO) => ReaderIO /** * @category do notation * @since 2.13.0 */ export declare const Do: ReaderIO /** * @category do notation * @since 2.13.0 */ export declare const bindTo: ( name: N ) => (fa: ReaderIO) => ReaderIO /** * @category do notation * @since 2.13.0 */ export declare const bind: ( name: Exclude, f: (a: A) => ReaderIO ) => (ma: ReaderIO) => ReaderIO /** * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category do notation * @since 2.13.0 */ export declare const bindW: ( name: Exclude, f: (a: A) => ReaderIO ) => (fa: ReaderIO) => ReaderIO< R1 & R2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @category do notation * @since 2.13.0 */ export declare const apS: ( name: Exclude, fb: ReaderIO ) => (fa: ReaderIO) => ReaderIO /** * Less strict version of [`apS`](#aps). * * The `W` suffix (short for **W**idening) means that the environment types will be merged. * * @category do notation * @since 2.13.0 */ export declare const apSW: ( name: Exclude, fb: ReaderIO ) => (fa: ReaderIO) => ReaderIO< R1 & R2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @since 2.13.0 */ export declare const ApT: ReaderIO /** * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.13.0 */ export declare const traverseReadonlyNonEmptyArrayWithIndex: ( f: (index: number, a: A) => ReaderIO ) => (as: ReadonlyNonEmptyArray) => ReaderIO> /** * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.13.0 */ export declare const traverseReadonlyArrayWithIndex: ( f: (index: number, a: A) => ReaderIO ) => (as: readonly A[]) => ReaderIO /** * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.13.0 */ export declare const traverseArrayWithIndex: ( f: (index: number, a: A) => ReaderIO ) => (as: ReadonlyArray) => ReaderIO> /** * Equivalent to `ReadonlyArray#traverse(Applicative)`. * * @category traversing * @since 2.13.0 */ export declare const traverseArray: ( f: (a: A) => ReaderIO ) => (as: readonly A[]) => ReaderIO /** * Equivalent to `ReadonlyArray#sequence(Applicative)`. * * @category traversing * @since 2.13.0 */ export declare const sequenceArray: (arr: ReadonlyArray>) => ReaderIO>