/** * @since 0.1.12 */ import { Applicative3 } from 'fp-ts/lib/Applicative' import { Apply3 } from 'fp-ts/lib/Apply' import * as E from 'fp-ts/lib/Either' import { Predicate, Refinement } from 'fp-ts/lib/function' import { Functor3 } from 'fp-ts/lib/Functor' import { Monad3 } from 'fp-ts/lib/Monad' import { MonadThrow3 } from 'fp-ts/lib/MonadThrow' import { Option } from 'fp-ts/lib/Option' import { State } from 'fp-ts/lib/State' /** * @category model * @since 0.1.12 */ export interface StateEither { (s: S): E.Either } /** * @category constructors * @since 0.1.12 */ export declare const get: () => StateEither /** * @category constructors * @since 0.1.12 */ export declare const put: (s: S) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const modify: (f: (s: S) => S) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const gets: (f: (s: S) => A) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const left: (e: E) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const right: (a: A) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const leftState: (me: State) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const rightState: (ma: State) => StateEither /** * @category constructors * @since 0.1.18 */ export declare const fromOption: (onNone: () => E) => (ma: Option) => StateEither /** * @category constructors * @since 0.1.0 */ export declare const fromEither: (ma: E.Either) => StateEither /** * @category constructors * @since 0.1.12 */ export declare const fromEitherK: , B>( f: (...a: A) => E.Either ) => (...a: A) => StateEither /** * @category constructors * @since 0.1.18 */ export declare const fromPredicate: { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => StateEither (predicate: Predicate, onFalse: (a: A) => E): (a: A) => StateEither } /** * @category combinators * @since 0.1.18 */ export declare const filterOrElse: { (refinement: Refinement, onFalse: (a: A) => E): ( ma: StateEither ) => StateEither (predicate: Predicate, onFalse: (a: A) => E): (ma: StateEither) => StateEither } /** * @category Functor * @since 0.1.18 */ export declare const map: (f: (a: A) => B) => (fa: StateEither) => StateEither /** * @category Apply * @since 0.1.18 */ export declare const ap: ( fa: StateEither ) => (fab: StateEither B>) => StateEither /** * @category Apply * @since 0.1.18 */ export declare const apFirst: ( fb: StateEither ) => (fa: StateEither) => StateEither /** * @category Apply * @since 0.1.18 */ export declare const apSecond: ( fb: StateEither ) => (fa: StateEither) => StateEither /** * @category Applicative * @since 0.1.18 */ export declare const of: (a: A) => StateEither /** * @category Monad * @since 0.1.18 */ export declare const chain: ( f: (a: A) => StateEither ) => (ma: StateEither) => StateEither /** * @category Monad * @since 0.1.18 */ export declare const chainFirst: ( f: (a: A) => StateEither ) => (ma: StateEither) => StateEither /** * @since 0.1.12 */ export declare const chainEitherK: ( f: (a: A) => E.Either ) => (ma: StateEither) => StateEither /** * @category Monad * @since 0.1.18 */ export declare const flatten: (mma: StateEither>) => StateEither /** * @category instances * @since 0.1.12 */ export declare const URI = 'StateEither' /** * @category instances * @since 0.1.12 */ export declare type URI = typeof URI declare module 'fp-ts/lib/HKT' { interface URItoKind3 { StateEither: StateEither } } /** * @category instances * @since 0.1.18 */ export declare const Functor: Functor3 /** * @category instances * @since 0.1.18 */ export declare const Applicative: Applicative3 /** * @category instances * @since 0.1.18 */ export declare const Apply: Apply3 /** * @category instances * @since 0.1.18 */ export declare const Monad: Monad3 /** * @category instances * @since 0.1.18 */ export declare const MonadThrow: MonadThrow3 /** * @category instances * @since 0.1.12 */ export declare const stateEither: Monad3 & MonadThrow3 /** * @since 0.1.12 */ export declare const evalState: (ma: StateEither, s: S) => E.Either /** * @since 0.1.12 */ export declare const execState: (ma: StateEither, s: S) => E.Either