Control.Comonad.Trans.Traced

comonad-transformers-2.0.2: Comonad transformers

Portability | portable
Stability | provisional
Maintainer | Edward Kmett <ekmett@gmail.com>

Control.Comonad.Trans.Traced

Contents

- Traced comonad
- Traced comonad transformer
- Operations

Description

The trace comonad transformer (aka the cowriter or exponential comonad transformer).

Synopsis

- type Traced m = TracedT m Identity
- traced :: (m -> a) -> Traced m a
- runTraced :: Traced m a -> m -> a
- newtype TracedT m w a = TracedT {
  - runTracedT :: w (m -> a)
  }
- trace :: (Comonad w, Monoid m) => m -> TracedT m w a -> a
- listen :: Functor w => TracedT m w a -> TracedT m w (a, m)
- listens :: Functor w => (m -> b) -> TracedT m w a -> TracedT m w (a, b)
- censor :: Functor w => (m -> m) -> TracedT m w a -> TracedT m w a

# Traced comonad

type Traced m = TracedT m Identity

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

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

# Traced comonad transformer

newtype TracedT m w a

Constructors

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

Instances

(Semigroup m, Monoid m) => ComonadTrans (TracedT m) |
(Semigroup m, Monoid m) => ComonadHoist (TracedT m) |
Functor w => Functor (TracedT m w) |
(Typeable s, Typeable1 w) => Typeable1 (TracedT s w) |
Applicative w => Applicative (TracedT m w) |
(Comonad w, Semigroup m, Monoid m) => Comonad (TracedT m w) |
(Extend w, Semigroup m) => Extend (TracedT m w) |
Distributive w => Distributive (TracedT m w) |
Apply w => Apply (TracedT m w) |

# Operations

trace :: (Comonad w, Monoid m) => m -> TracedT m w a -> a

listen :: Functor w => TracedT m w a -> TracedT m w (a, m)

listens :: Functor w => (m -> b) -> TracedT m w a -> TracedT m w (a, b)

censor :: Functor w => (m -> m) -> TracedT m w a -> TracedT m w a