comonad-5.0.2: Comonads

Copyright(C) 2008-2014 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Control.Comonad.Trans.Traced

Contents

Description

The trace comonad builds up a result by prepending monoidal values to each other.

This module specifies the traced comonad transformer (aka the cowriter or exponential comonad transformer).

Synopsis

Traced comonad

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

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

Traced comonad transformer

newtype TracedT m w a Source #

Constructors

TracedT 

Fields

Instances

(ComonadEnv e w, Monoid m) => ComonadEnv e (TracedT m w) Source # 

Methods

ask :: TracedT m w a -> e Source #

(ComonadStore s w, Monoid m) => ComonadStore s (TracedT m w) Source # 

Methods

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 #

(Comonad w, Monoid m) => ComonadTraced m (TracedT m w) Source # 

Methods

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

ComonadHoist (TracedT m) Source # 

Methods

cohoist :: (Comonad w, Comonad v) => (forall x. w x -> v x) -> TracedT m w a -> TracedT m v a Source #

Monoid m => ComonadTrans (TracedT m) Source # 

Methods

lower :: Comonad w => TracedT m w a -> w a Source #

Functor w => Functor (TracedT m w) Source # 

Methods

fmap :: (a -> b) -> TracedT m w a -> TracedT m w b #

(<$) :: a -> TracedT m w b -> TracedT m w a #

Applicative w => Applicative (TracedT m w) Source # 

Methods

pure :: a -> TracedT m w a #

(<*>) :: 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) Source # 

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 m => m (TracedT m w a) -> TracedT m w (m a) #

collectM :: Monad m => (a -> TracedT m w b) -> m a -> TracedT m w (m b) #

(ComonadApply w, Monoid m) => ComonadApply (TracedT m w) Source # 

Methods

(<@>) :: TracedT m w (a -> b) -> TracedT m w a -> TracedT m w b Source #

(@>) :: TracedT m w a -> TracedT m w b -> TracedT m w b Source #

(<@) :: TracedT m w a -> TracedT m w b -> TracedT m w a Source #

(Comonad w, Monoid m) => Comonad (TracedT m w) Source # 

Methods

extract :: TracedT m w a -> a Source #

duplicate :: TracedT m w a -> TracedT m w (TracedT m w a) Source #

extend :: (TracedT m w a -> b) -> TracedT m w a -> TracedT m w b Source #

Operations

trace :: Comonad w => m -> TracedT m w a -> a Source #

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

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

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