Control.Comonad.Traced

comonad-5.0.9: Comonads

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

Control.Comonad.Traced

Contents

- ComonadTraced class
- The Traced comonad
- The TracedT comonad transformer
- Re-exported modules

Description

Synopsis

- class Comonad w => ComonadTraced m (w :: Type -> Type) | w -> m where
  - trace :: 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 :: Type -> Type) a = TracedT {
  - runTracedT :: w (m -> a)
  }
- module Control.Comonad
- module Control.Comonad.Trans.Class
- module Data.Monoid

# ComonadTraced class

class Comonad w => ComonadTraced m (w :: Type -> Type) | w -> m where #

Methods

trace :: m -> w a -> a #

#### Instances

Instances details

ComonadTraced m w => ComonadTraced m (EnvT e w) # |
Instance details Defined in Control.Comonad.Traced.Class Methods trace :: m -> EnvT e w a -> a #
ComonadTraced m w => ComonadTraced m (StoreT s w) # |
Instance details Defined in Control.Comonad.Traced.Class Methods trace :: m -> StoreT s w a -> a #
(Comonad w, Monoid m) => ComonadTraced m (TracedT m w) # |
Instance details Defined in Control.Comonad.Traced.Class Methods trace :: m -> TracedT m w a -> a #
ComonadTraced m w => ComonadTraced m (IdentityT w) # |
Instance details Defined in Control.Comonad.Traced.Class Methods trace :: m -> IdentityT w a -> a #
Monoid m => ComonadTraced m ((->) m) # |
Instance details Defined in Control.Comonad.Traced.Class Methods trace :: m -> (m -> a) -> a #

traces :: ComonadTraced m w => (a -> m) -> w a -> a #

# The Traced comonad

type Traced m = TracedT m Identity #

traced :: (m -> a) -> Traced m a #

runTraced :: Traced m a -> m -> a #

# The TracedT comonad transformer

newtype TracedT m (w :: Type -> Type) a #

Constructors

TracedT |
Fields runTracedT :: w (m -> a)

#### Instances

Instances details

(ComonadEnv e w, Monoid m) => ComonadEnv e (TracedT m w) # |
Instance details Defined in Control.Comonad.Env.Class Methods ask :: TracedT m w a -> e #
(ComonadStore s w, Monoid m) => ComonadStore s (TracedT m w) # |
Instance details Defined in Control.Comonad.Store.Class Methods pos :: TracedT m w a -> s # peek :: s -> TracedT m w a -> a # peeks :: (s -> s) -> TracedT m w a -> a # seek :: s -> TracedT m w a -> TracedT m w a # seeks :: (s -> s) -> TracedT m w a -> TracedT m w a # experiment :: Functor f => (s -> f s) -> TracedT m w a -> f a #
(Comonad w, Monoid m) => ComonadTraced m (TracedT m w) # |
Instance details Defined in Control.Comonad.Traced.Class Methods trace :: m -> TracedT m w a -> a #
ComonadHoist (TracedT m) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods cohoist :: (Comonad w, Comonad v) => (forall x. w x -> v x) -> TracedT m w a -> TracedT m v a #
Monoid m => ComonadTrans (TracedT m) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods lower :: Comonad w => TracedT m w a -> w a #
(Comonad w, Monoid m) => Comonad (TracedT m w) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods extract :: TracedT m w a -> a # duplicate :: TracedT m w a -> TracedT m w (TracedT m w a) # extend :: (TracedT m w a -> b) -> TracedT m w a -> TracedT m w b #
(ComonadApply w, Monoid m) => ComonadApply (TracedT m w) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods (<@>) :: TracedT m w (a -> b) -> TracedT m w a -> TracedT m w b # (@>) :: TracedT m w a -> TracedT m w b -> TracedT m w b # (<@) :: TracedT m w a -> TracedT m w b -> TracedT m w a #
Distributive w => Distributive (TracedT m w) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods distribute :: Functor f => f (TracedT m w a) -> TracedT m w (f a) # collect :: Functor f => (a -> TracedT m w b) -> f a -> TracedT m w (f b) # distributeM :: Monad m0 => m0 (TracedT m w a) -> TracedT m w (m0 a) # collectM :: Monad m0 => (a -> TracedT m w b) -> m0 a -> TracedT m w (m0 b) #
Applicative w => Applicative (TracedT m w) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods pure :: a -> TracedT m w a # (<*>) :: TracedT m w (a -> b) -> TracedT m w a -> TracedT m w b # liftA2 :: (a -> b -> c) -> TracedT m w a -> TracedT m w b -> TracedT m w c # (*>) :: TracedT m w a -> TracedT m w b -> TracedT m w b # (<*) :: TracedT m w a -> TracedT m w b -> TracedT m w a #
Functor w => Functor (TracedT m w) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods fmap :: (a -> b) -> TracedT m w a -> TracedT m w b # (<$) :: a -> TracedT m w b -> TracedT m w a #
FunctorWithIndex i w => FunctorWithIndex (s, i) (TracedT s w) # |
Instance details Defined in Control.Comonad.Trans.Traced Methods imap :: ((s, i) -> a -> b) -> TracedT s w a -> TracedT s w b #

# Re-exported modules

module Control.Comonad

module Control.Comonad.Trans.Class

module Data.Monoid