Store overview

Added in v2.0.0


Table of contents


Extend

duplicate

Signature

export declare const duplicate: <E, A>(wa: Store<E, A>) => Store<E, Store<E, A>>

Added in v2.0.0

extend

Signature

export declare const extend: <E, A, B>(f: (wa: Store<E, A>) => B) => (wa: Store<E, A>) => Store<E, B>

Added in v2.0.0

Extract

extract

Signature

export declare const extract: <E, A>(wa: Store<E, A>) => A

Added in v2.6.2

Functor

map

map can be used to turn functions (a: A) => B into functions (fa: F<A>) => F<B> whose argument and return types use the type constructor F to represent some computational context.

Signature

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

Added in v2.0.0

instances

URI

Signature

export declare const URI: 'Store'

Added in v2.0.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.0.0

comonadStore

Signature

export declare const comonadStore: Comonad2<'Store'>

Added in v2.7.0

functorStore

Signature

export declare const functorStore: Functor2<'Store'>

Added in v2.7.0

store

Signature

export declare const store: Comonad2<'Store'>

Added in v2.0.0

model

Store (interface)

Signature

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

Added in v2.0.0

utils

experiment

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

Signature

export declare 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 declare 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 declare 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 declare 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 declare function experiment<F extends URIS>(
  F: Functor1<F>
): <S>(f: (s: S) => Kind<F, S>) => <A>(wa: Store<S, A>) => Kind<F, A>
export declare 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

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

Signature

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

Added in v2.0.0

seek

Reposition the focus at the specified position

Signature

export declare function seek<S>(s: S): <A>(wa: Store<S, A>) => Store<S, A>

Added in v2.0.0

seeks

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

Signature

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

Added in v2.0.0