Link Search Menu Expand Document

StateTaskEither overview

Added in v0.1.0


Table of contents


Applicative

of

Signature

export declare const of: <R, E, A>(a: A) => StateTaskEither<R, E, A>

Added in v0.1.18

Apply

ap

Signature

export declare const ap: <R, E, A>(
  fa: StateTaskEither<R, E, A>
) => <B>(fab: StateTaskEither<R, E, (a: A) => B>) => StateTaskEither<R, E, B>

Added in v0.1.18

apFirst

Signature

export declare const apFirst: <R, E, B>(
  fb: StateTaskEither<R, E, B>
) => <A>(fa: StateTaskEither<R, E, A>) => StateTaskEither<R, E, A>

Added in v0.1.18

apSecond

Signature

export declare const apSecond: <R, E, B>(
  fb: StateTaskEither<R, E, B>
) => <A>(fa: StateTaskEither<R, E, A>) => StateTaskEither<R, E, B>

Added in v0.1.18

Functor

map

Signature

export declare const map: <A, B>(f: (a: A) => B) => <R, E>(fa: StateTaskEither<R, E, A>) => StateTaskEither<R, E, B>

Added in v0.1.18

Monad

chain

Signature

export declare const chain: <R, E, A, B>(
  f: (a: A) => StateTaskEither<R, E, B>
) => (ma: StateTaskEither<R, E, A>) => StateTaskEither<R, E, B>

Added in v0.1.18

chainEitherK

Signature

export declare const chainEitherK: <E, A, B>(
  f: (a: A) => Either<E, B>
) => <S>(ma: StateTaskEither<S, E, A>) => StateTaskEither<S, E, B>

Added in v0.1.10

chainFirst

Signature

export declare const chainFirst: <R, E, A, B>(
  f: (a: A) => StateTaskEither<R, E, B>
) => (ma: StateTaskEither<R, E, A>) => StateTaskEither<R, E, A>

Added in v0.1.18

chainIOEitherK

Signature

export declare const chainIOEitherK: <E, A, B>(
  f: (a: A) => IOEither<E, B>
) => <S>(ma: StateTaskEither<S, E, A>) => StateTaskEither<S, E, B>

Added in v0.1.10

chainTaskEitherK

Signature

export declare const chainTaskEitherK: <E, A, B>(
  f: (a: A) => TE.TaskEither<E, B>
) => <S>(ma: StateTaskEither<S, E, A>) => StateTaskEither<S, E, B>

Added in v0.1.10

flatten

Signature

export declare const flatten: <R, E, A>(
  mma: StateTaskEither<R, E, StateTaskEither<R, E, A>>
) => StateTaskEither<R, E, A>

Added in v0.1.18

combinators

filterOrElse

Signature

export declare const filterOrElse: {
  <E, A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(
    ma: StateTaskEither<R, E, A>
  ) => StateTaskEither<R, E, B>
  <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(ma: StateTaskEither<R, E, A>) => StateTaskEither<R, E, A>
}

Added in v0.1.18

constructors

fromEither

Signature

export declare const fromEither: <R, E, A>(ma: Either<E, A>) => StateTaskEither<R, E, A>

Added in v0.1.18

fromEitherK

Signature

export declare const fromEitherK: <E, A extends unknown[], B>(
  f: (...a: A) => Either<E, B>
) => <S>(...a: A) => StateTaskEither<S, E, B>

Added in v0.1.10

fromIOEither

Signature

export declare const fromIOEither: <S, E, A>(ma: IOEither<E, A>) => StateTaskEither<S, E, A>

Added in v0.1.0

fromIOEitherK

Signature

export declare const fromIOEitherK: <E, A extends unknown[], B>(
  f: (...a: A) => IOEither<E, B>
) => <S>(...a: A) => StateTaskEither<S, E, B>

Added in v0.1.10

fromOption

Signature

export declare const fromOption: <E>(onNone: () => E) => <R, A>(ma: Option<A>) => StateTaskEither<R, E, A>

Added in v0.1.18

fromPredicate

Signature

export declare const fromPredicate: {
  <E, A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(a: A) => StateTaskEither<R, E, B>
  <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(a: A) => StateTaskEither<R, E, A>
}

Added in v0.1.18

fromTaskEither

Signature

export declare const fromTaskEither: <S, E, A>(ma: TE.TaskEither<E, A>) => StateTaskEither<S, E, A>

Added in v0.1.0

fromTaskEitherK

Signature

export declare const fromTaskEitherK: <E, A extends unknown[], B>(
  f: (...a: A) => TE.TaskEither<E, B>
) => <S>(...a: A) => StateTaskEither<S, E, B>

Added in v0.1.10

get

Signature

export declare const get: <S>() => StateTaskEither<S, never, S>

Added in v0.1.0

gets

Signature

export declare const gets: <S, A>(f: (s: S) => A) => StateTaskEither<S, never, A>

Added in v0.1.0

left

Signature

export declare const left: <S, E>(e: E) => StateTaskEither<S, E, never>

Added in v0.1.0

leftIO

Signature

export declare const leftIO: <S, E>(me: IO<E>) => StateTaskEither<S, E, never>

Added in v0.1.0

leftState

Signature

export declare const leftState: <S, E>(me: State<S, E>) => StateTaskEither<S, E, never>

Added in v0.1.0

leftTask

Signature

export declare const leftTask: <S, E>(me: Task<E>) => StateTaskEither<S, E, never>

Added in v0.1.0

modify

Signature

export declare const modify: <S>(f: (s: S) => S) => StateTaskEither<S, never, void>

Added in v0.1.0

put

Signature

export declare const put: <S>(s: S) => StateTaskEither<S, never, void>

Added in v0.1.0

Signature

export declare const right: <S, A>(a: A) => StateTaskEither<S, never, A>

Added in v0.1.0

rightIO

Signature

export declare const rightIO: <S, A>(ma: IO<A>) => StateTaskEither<S, never, A>

Added in v0.1.0

rightState

Signature

export declare const rightState: <S, A>(ma: State<S, A>) => StateTaskEither<S, never, A>

Added in v0.1.0

rightTask

Signature

export declare const rightTask: <S, A>(ma: Task<A>) => StateTaskEither<S, never, A>

Added in v0.1.0

instances

Applicative

Signature

export declare const Applicative: Applicative3<'StateTaskEither'>

Added in v0.1.18

Apply

Signature

export declare const Apply: Apply3<'StateTaskEither'>

Added in v0.1.18

Functor

Signature

export declare const Functor: Functor3<'StateTaskEither'>

Added in v0.1.18

Monad

Signature

export declare const Monad: Monad3<'StateTaskEither'>

Added in v0.1.18

URI

Signature

export declare const URI: 'StateTaskEither'

Added in v0.1.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v0.1.0

stateTaskEither

Signature

export declare const stateTaskEither: Monad3<'StateTaskEither'> & MonadThrow3<'StateTaskEither'>

Added in v0.1.0

stateTaskEitherSeq

Like stateTaskEither but ap is sequential

Signature

export declare const stateTaskEitherSeq: Monad3<'StateTaskEither'> & MonadThrow3<'StateTaskEither'>

Added in v0.1.0

model

StateTaskEither (interface)

Signature

export interface StateTaskEither<S, E, A> {
  (s: S): TaskEither<E, [A, S]>
}

Added in v0.1.0

utils

evalState

Signature

export declare const evalState: <S, E, A>(ma: StateTaskEither<S, E, A>, s: S) => TE.TaskEither<E, A>

Added in v0.1.0

execState

Signature

export declare const execState: <S, E, A>(ma: StateTaskEither<S, E, A>, s: S) => TE.TaskEither<E, S>

Added in v0.1.0

run

Signature

export declare const run: <S, E, A>(ma: StateTaskEither<S, E, A>, s: S) => Promise<Either<E, [A, S]>>

Added in v0.1.0