Reader overview

Added in v2.0.0


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

Signature

export const URI: "Reader" = ...

Added in v2.0.0

ap

Signature

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

Added in v2.0.0

apFirst

Signature

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

Added in v2.0.0

apSecond

Signature

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

Added in v2.0.0

ask

Reads the current context

Signature

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

Added in v2.0.0

asks

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

chain

Signature

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

Added in v2.0.0

chainFirst

Signature

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

Added in v2.0.0

compose

Signature

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

Added in v2.0.0

flatten

Signature

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

Added in v2.0.0

getMonoid

Signature

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

Added in v2.0.0

getSemigroup

Signature

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

Added in v2.0.0

local

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

map

Signature

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

Added in v2.0.0

of

Signature

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

Added in v2.0.0

promap

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

reader

Signature

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

Added in v2.0.0