Control.Comonad.Trans.Traced.Memo

comonad-transformers-2.0.2: Comonad transformers

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

Control.Comonad.Trans.Traced.Memo

Contents

- Traced comonad
- Traced comonad transformer
- Operations

Description

The memoized traced comonad transformer (aka the cowriter or exponential comonad transformer).

Synopsis

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

# Traced comonad

type Traced m = TracedT m Identity

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

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

# Traced comonad transformer

data TracedT m w a

Instances

ComonadTrans (TracedT 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, Monoid m) => Comonad (TracedT m w) |
(Extend w, Monoid m) => Extend (TracedT m w) |
Apply w => Apply (TracedT m w) |

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

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

# Operations

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

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

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

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