HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleadjunctions-4.4.3Haskell2010

Control.Comonad.Representable.Store

This is a generalized Store Comonad, parameterized by a Representable Functor. The representation of that Functor serves as the index of the store.

This can be useful if the representable functor serves to memoize its contents and will be inspected often.

  • 2 types
  • 1 class
  • 4 values
typetype Store (g :: Type -> Type) = StoreT g Identity
#

A memoized store comonad parameterized by a representable functor g, where the representatation of g, Rep g is the index of the store.

valuerunStore
  1. :: Representable g
  2. => Store g a

    a store to access

  3. -> (Rep g -> a, Rep g)

    initial state

#

Unwrap a store comonad computation as a function and a current index. (The inverse of store.)

datadata StoreT (g :: Type -> Type) (w :: Type -> Type) a
#

A store transformer comonad parameterized by:

  • g - A representable functor used to memoize results for an index Rep g

  • w - The inner comonad.

Constructors

Instances12ComonadEnv, ComonadStore, ComonadTraced, ComonadCofree, ComonadTrans, ComonadHoist, …
classclass Comonad w => ComonadStore s (w :: Type -> Type) | w -> s where
#

Methods

Instances7ComonadStore, …