← Back

Source

store

Comonad2<URI>

Added in v1.0.0 (instance)

Store

constructor(readonly peek: (s: S) => A, readonly pos: S) {}

Added in v1.0.0 (data)

extend

<B>(f: (sa: Store<S, A>) => B): Store<S, B>

Added in v1.0.0 (method)

extract

(): A

Added in v1.0.0 (method)

inspect

(): string

Added in v1.0.0 (method)

map

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

Added in v1.0.0 (method)

seek

(s: S): Store<S, A>

Added in v1.0.0 (method)

Reposition the focus at the specified position

toString

(): string

Added in v1.0.0 (method)

experiment

experiment<F>(F: Functor<F>): <S>(f: (s: S) => HKT<F, S>) => <A>(sa: Store<S, A>) => HKT<F, A>

Added in v1.0.0 (function)

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

peeks

<S>(f: Endomorphism<S>) => <A>(sa: Store<S, A>) => (s: S): A

Added in v1.0.0 (function)

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

seeks

<S>(f: Endomorphism<S>) => <A>(sa: Store<S, A>): Store<S, A>

Added in v1.0.0 (function)

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