package preface

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Operation of Store comonad parametrized over an inner comonad and store.

type store

The encapsulated store.

type 'a comonad

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 : Functor.API) : sig ... end

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