-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Comonad transformers using functional dependencies -- -- Comonad transformers using functional dependencies @package comonads-fd @version 3.0 module Control.Comonad.Traced.Class class Comonad w => ComonadTraced m w | w -> m trace :: ComonadTraced m w => m -> w a -> a traces :: ComonadTraced m w => (a -> m) -> w a -> a instance ComonadTraced m w => ComonadTraced m (StoreT s w) instance ComonadTraced m w => ComonadTraced m (EnvT e w) instance ComonadTraced m w => ComonadTraced m (IdentityT w) instance (Comonad w, Monoid m) => ComonadTraced m (TracedT m w) module Control.Comonad.Traced class Comonad w => ComonadTraced m w | w -> m trace :: ComonadTraced m w => m -> w a -> a traces :: ComonadTraced m w => (a -> m) -> w a -> a type Traced m = TracedT m Identity traced :: (m -> a) -> Traced m a runTraced :: Traced m a -> m -> a newtype TracedT m (w :: * -> *) a :: * -> (* -> *) -> * -> * TracedT :: w (m -> a) -> TracedT m a runTracedT :: TracedT m a -> w (m -> a) module Control.Comonad.Store.Class class Comonad w => ComonadStore s w | w -> s where peeks f w = peek (f (pos w)) w seek s = peek s . duplicate seeks f = peeks f . duplicate experiment f w = fmap (`peek` w) (f (pos w)) pos :: ComonadStore s w => w a -> s peek :: ComonadStore s w => s -> w a -> a peeks :: ComonadStore s w => (s -> s) -> w a -> a seek :: ComonadStore s w => s -> w a -> w a seeks :: ComonadStore s w => (s -> s) -> w a -> w a experiment :: (ComonadStore s w, Functor f) => (s -> f s) -> w a -> f a lowerPos :: (ComonadTrans t, ComonadStore s w) => t w a -> s lowerPeek :: (ComonadTrans t, ComonadStore s w) => s -> t w a -> a instance (ComonadStore s w, Monoid m) => ComonadStore s (TracedT m w) instance ComonadStore s w => ComonadStore s (EnvT e w) instance ComonadStore s w => ComonadStore s (IdentityT w) instance Comonad w => ComonadStore s (StoreT s w) module Control.Comonad.Store class Comonad w => ComonadStore s w | w -> s where peeks f w = peek (f (pos w)) w seek s = peek s . duplicate seeks f = peeks f . duplicate experiment f w = fmap (`peek` w) (f (pos w)) pos :: ComonadStore s w => w a -> s peek :: ComonadStore s w => s -> w a -> a peeks :: ComonadStore s w => (s -> s) -> w a -> a seek :: ComonadStore s w => s -> w a -> w a seeks :: ComonadStore s w => (s -> s) -> w a -> w a experiment :: (ComonadStore s w, Functor f) => (s -> f s) -> w a -> f a type Store s = StoreT s Identity store :: (s -> a) -> s -> Store s a runStore :: Store s a -> (s -> a, s) data StoreT s (w :: * -> *) a :: * -> (* -> *) -> * -> * StoreT :: w (s -> a) -> s -> StoreT s a runStoreT :: StoreT s w a -> (w (s -> a), s) module Control.Comonad.Identity module Control.Comonad.Env.Class class Comonad w => ComonadEnv e w | w -> e ask :: ComonadEnv e w => w a -> e asks :: ComonadEnv e w => (e -> e') -> w a -> e' instance (ComonadEnv e w, Monoid m) => ComonadEnv e (TracedT m w) instance ComonadEnv e w => ComonadEnv e (IdentityT w) instance ComonadEnv e w => ComonadEnv e (StoreT t w) instance ComonadEnv e ((,) e) instance Comonad w => ComonadEnv e (EnvT e w) -- | The Env comonad (aka the Coreader, Environment, or Product comonad) -- -- A co-Kleisli arrow in the Env comonad is isomorphic to a Kleisli arrow -- in the reader monad. -- -- (a -> e -> m) ~ (a, e) -> m ~ Env e a -> m module Control.Comonad.Env class Comonad w => ComonadEnv e w | w -> e ask :: ComonadEnv e w => w a -> e asks :: ComonadEnv e w => (e -> e') -> w a -> e' local :: (e -> e) -> EnvT e w a -> EnvT e w a type Env e = EnvT e Identity env :: e -> a -> Env e a runEnv :: Env e a -> (e, a) data EnvT e (w :: * -> *) a :: * -> (* -> *) -> * -> * EnvT :: e -> w a -> EnvT e a runEnvT :: EnvT e w a -> (e, w a)