Module Store.Core_over_comonad

Parameters

Signature

type store = Store.t

The encapsulated store.

type 'a comonad = 'a C.t

The inner comonad.

type 'a t = (store -> 'a) comonad * store

The type held by the store comonad.

val lower : 'a t -> 'a comonad

get the underlying comonad.

val run : 'a t -> (store -> 'a) comonad * store

Unwrap the store computation.

val pos : 'a t -> store

Read the stored value.

val peek : store -> 'a t -> 'a

Get the current focus for a different stored value (absolute getter).

val peeks : (store -> store) -> 'a t -> 'a

Get the current focus for a different modified stored value (absolute setter).

val seek : store -> 'a t -> 'a t

Move the current focus (absolute setter).

val seeks : (store -> store) -> 'a t -> 'a t

Modify (set and apply a function) the focus (relative setter).

module Experiment (F : Preface_specs.Functor.API) : sig ... end

Applies a function which lift the store to a functor-value and use the accessor to read the resulting focus.