Portability | portable |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
The trie-memoizing store (state-in-context/costate) comonad transformer is subject to the laws:
x = seek (pos x) x y = pos (seek y x) seek y x = seek y (seek z x)
Thanks go to Russell O'Connor and Daniel Peebles for their help formulating and proving the laws for this comonad transformer.
- type Store s = StoreT s Identity
- store :: HasTrie s => (s -> a) -> s -> Store s a
- runStore :: HasTrie s => Store s a -> (s -> a, s)
- data StoreT s w a = StoreT (w (s :->: a)) s
- storeT :: (Functor w, HasTrie s) => w (s -> a) -> s -> StoreT s w a
- runStoreT :: (Functor w, HasTrie s) => StoreT s w a -> (w (s -> a), s)
- module Control.Comonad.Store.Class
The Store comonad
The Store comonad transformer
(ComonadEnv m w, HasTrie s) => ComonadEnv m (StoreT s w) | |
(Comonad w, HasTrie s) => ComonadStore s (StoreT s w) | |
(ComonadTraced m w, HasTrie s) => ComonadTraced m (StoreT s w) | |
ComonadHoist (StoreT s) | |
HasTrie s => ComonadTrans (StoreT s) | |
(Functor w, HasTrie s) => Functor (StoreT s w) | |
(Typeable s, Typeable1 w) => Typeable1 (StoreT s w) | |
(Comonad w, HasTrie s) => Comonad (StoreT s w) | |
(Extend w, HasTrie s) => Extend (StoreT s w) | |
(Typeable s, Typeable1 w, Typeable a) => Typeable (StoreT s w a) |
Operations
module Control.Comonad.Store.Class