Table of contents


Reader (interface)

Signature

export interface Reader<R, A> {
  (r: R): A
}

Added in v2.0.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.0.0

URI (constant)

Signature

export const URI: "Reader" = ...

Added in v2.0.0

ask (constant)

Reads the current context

Signature

export const ask: <R>() => Reader<R, R> = ...

Added in v2.0.0

asks (constant)

Projects a value from the global context in a Reader

Signature

export const asks: <R, A>(f: (r: R) => A) => Reader<R, A> = ...

Added in v2.0.0

of (constant)

Signature

export const of: <R, A>(a: A) => Reader<R, A> = ...

Added in v2.0.0

reader (constant)

Signature

export const reader: Monad2<URI> & Profunctor2<URI> & Category2<URI> & Strong2<URI> & Choice2<URI> = ...

Added in v2.0.0

getMonoid (function)

Signature

export function getMonoid<R, A>(M: Monoid<A>): Monoid<Reader<R, A>> { ... }

Added in v2.0.0

getSemigroup (function)

Signature

export function getSemigroup<R, A>(S: Semigroup<A>): Semigroup<Reader<R, A>> { ... }

Added in v2.0.0

local (function)

Changes the value of the local context during the execution of the action ma (similar to Contravariant’s contramap).

Signature

export function local<Q, R>(f: (d: Q) => R): <A>(ma: Reader<R, A>) => Reader<Q, A> { ... }

Added in v2.0.0

ap (export)

Signature

<E, A>(fa: Reader<E, A>) => <B>(fab: Reader<E, (a: A) => B>) => Reader<E, B>

Added in v2.0.0

apFirst (export)

Signature

<E, B>(fb: Reader<E, B>) => <A>(fa: Reader<E, A>) => Reader<E, A>

Added in v2.0.0

apSecond (export)

Signature

<E, B>(fb: Reader<E, B>) => <A>(fa: Reader<E, A>) => Reader<E, B>

Added in v2.0.0

chain (export)

Signature

<E, A, B>(f: (a: A) => Reader<E, B>) => (ma: Reader<E, A>) => Reader<E, B>

Added in v2.0.0

chainFirst (export)

Signature

<E, A, B>(f: (a: A) => Reader<E, B>) => (ma: Reader<E, A>) => Reader<E, A>

Added in v2.0.0

compose (export)

Signature

<E, A>(la: Reader<E, A>) => <B>(ab: Reader<A, B>) => Reader<E, B>

Added in v2.0.0

flatten (export)

Signature

<E, A>(mma: Reader<E, Reader<E, A>>) => Reader<E, A>

Added in v2.0.0

map (export)

Signature

<A, B>(f: (a: A) => B) => <E>(fa: Reader<E, A>) => Reader<E, B>

Added in v2.0.0

promap (export)

Signature

<E, A, D, B>(f: (d: D) => E, g: (a: A) => B) => (fbc: Reader<E, A>) => Reader<D, B>

Added in v2.0.0