Table of contents


Store (interface)

Signature

export interface Store<S, A> {
  readonly peek: (s: S) => A
  readonly pos: S
}

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: "Store" = ...

Added in v2.0.0

store (constant)

Signature

export const store: Comonad2<URI> = ...

Added in v2.0.0

experiment (function)

Extract a collection of values from positions which depend on the current position

Signature

export function experiment<F extends URIS3>(
  F: Functor3<F>
): <R, E, S>(f: (s: S) => Kind3<F, R, E, S>) => <A>(wa: Store<S, A>) => Kind3<F, R, E, A>
export function experiment<F extends URIS3, E>(
  F: Functor3C<F, E>
): <R, S>(f: (s: S) => Kind3<F, R, E, S>) => <A>(wa: Store<S, A>) => Kind3<F, R, E, A>
export function experiment<F extends URIS2>(
  F: Functor2<F>
): <E, S>(f: (s: S) => Kind2<F, E, S>) => <A>(wa: Store<S, A>) => Kind2<F, E, A>
export function experiment<F extends URIS2, E>(
  F: Functor2C<F, E>
): <S>(f: (s: S) => Kind2<F, E, S>) => <A>(wa: Store<S, A>) => Kind2<F, E, A>
export function experiment<F extends URIS>(
  F: Functor1<F>
): <S>(f: (s: S) => Kind<F, S>) => <A>(wa: Store<S, A>) => Kind<F, A>
export function experiment<F>(F: Functor<F>): <S>(f: (s: S) => HKT<F, S>) => <A>(wa: Store<S, A>) => HKT<F, A> { ... }

Added in v2.0.0

peeks (function)

Extract a value from a position which depends on the current position

Signature

export function peeks<S>(f: Endomorphism<S>): <A>(wa: Store<S, A>) => A { ... }

Added in v2.0.0

seek (function)

Reposition the focus at the specified position

Signature

export function seek<S>(s: S): <A>(wa: Store<S, A>) => Store<S, A> { ... }

Added in v2.0.0

seeks (function)

Reposition the focus at the specified position, which depends on the current position

Signature

export function seeks<S>(f: Endomorphism<S>): <A>(wa: Store<S, A>) => Store<S, A> { ... }

Added in v2.0.0

duplicate (export)

Signature

<E, A>(ma: Store<E, A>) => Store<E, Store<E, A>>

Added in v2.0.0

extend (export)

Signature

<E, A, B>(f: (fa: Store<E, A>) => B) => (ma: Store<E, A>) => Store<E, B>

Added in v2.0.0

map (export)

Signature

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

Added in v2.0.0