Copyright | (C) 2008-2014 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable (fundeps, MPTCs) |
Safe Haskell | Safe |
Language | Haskell2010 |
Synopsis
- class Comonad w => ComonadStore s (w :: Type -> Type) | w -> s where
- type Store s = StoreT s Identity
- store :: (s -> a) -> s -> Store s a
- runStore :: Store s a -> (s -> a, s)
- data StoreT s (w :: Type -> Type) a = StoreT (w (s -> a)) s
- runStoreT :: StoreT s w a -> (w (s -> a), s)
- module Control.Comonad
- module Control.Comonad.Trans.Class
ComonadStore class
class Comonad w => ComonadStore s (w :: Type -> Type) | w -> s where Source #
peek :: s -> w a -> a Source #
peeks :: (s -> s) -> w a -> a Source #
seek :: s -> w a -> w a Source #
seeks :: (s -> s) -> w a -> w a Source #
experiment :: Functor f => (s -> f s) -> w a -> f a Source #
Instances
ComonadStore s w => ComonadStore s (EnvT e w) Source # | |
Defined in Control.Comonad.Store.Class | |
Comonad w => ComonadStore s (StoreT s w) Source # | |
Defined in Control.Comonad.Store.Class | |
(ComonadStore s w, Monoid m) => ComonadStore s (TracedT m w) Source # | |
Defined in Control.Comonad.Store.Class pos :: TracedT m w a -> s Source # peek :: s -> TracedT m w a -> a Source # peeks :: (s -> s) -> TracedT m w a -> a Source # seek :: s -> TracedT m w a -> TracedT m w a Source # seeks :: (s -> s) -> TracedT m w a -> TracedT m w a Source # experiment :: Functor f => (s -> f s) -> TracedT m w a -> f a Source # | |
ComonadStore s w => ComonadStore s (IdentityT w) Source # | |
Defined in Control.Comonad.Store.Class pos :: IdentityT w a -> s Source # peek :: s -> IdentityT w a -> a Source # peeks :: (s -> s) -> IdentityT w a -> a Source # seek :: s -> IdentityT w a -> IdentityT w a Source # seeks :: (s -> s) -> IdentityT w a -> IdentityT w a Source # experiment :: Functor f => (s -> f s) -> IdentityT w a -> f a Source # |
The Store comonad
store :: (s -> a) -> s -> Store s a Source #
Create a Store using an accessor function and a stored value
The StoreT comonad transformer
data StoreT s (w :: Type -> Type) a Source #
StoreT (w (s -> a)) s |
Instances
ComonadEnv e w => ComonadEnv e (StoreT t w) Source # | |
Defined in Control.Comonad.Env.Class | |
Comonad w => ComonadStore s (StoreT s w) Source # | |
Defined in Control.Comonad.Store.Class | |
ComonadTraced m w => ComonadTraced m (StoreT s w) Source # | |
Defined in Control.Comonad.Traced.Class | |
ComonadHoist (StoreT s) Source # | |
ComonadTrans (StoreT s) Source # | |
(Applicative w, Monoid s) => Applicative (StoreT s w) Source # | |
Defined in Control.Comonad.Trans.Store | |
Functor w => Functor (StoreT s w) Source # | |
Comonad w => Comonad (StoreT s w) Source # | |
(ComonadApply w, Semigroup s) => ComonadApply (StoreT s w) Source # | |
Re-exported modules
module Control.Comonad
module Control.Comonad.Trans.Class