Module
Control.Comonad.Traced
- Package
- purescript-transformers
- Repository
- purescript/purescript-transformers
This module defines the Traced
comonad.
Re-exports from Control.Comonad.Traced.Class
#ComonadTraced Source
class ComonadTraced :: Type -> (Type -> Type) -> Constraint
class (Comonad w) <= ComonadTraced t w | w -> t where
The ComonadTraced
type class represents those monads which support relative (monoidal)
position information via track
.
track
extracts a value at the specified relative position.
An implementation is provided for TracedT
.
Laws:
track mempty = extract
(track s =<= track t) x = track (s <> t) x
For example:
blur :: forall w. (ComonadTraced (Additive Number) w) -> w Number -> w Number
blur = extend \r -> (track (Additive (-1)) r + track (Additive 1) r) / 2
Members
track :: forall a. t -> w a -> a
Instances
(Comonad w, Monoid t) => ComonadTraced t (TracedT t w)
#tracks Source
tracks :: forall w a t. ComonadTraced t w => (a -> t) -> w a -> a
Extracts a value at a relative position which depends on the current value.
Re-exports from Control.Comonad.Traced.Trans
#TracedT Source
newtype TracedT :: Type -> (Type -> Type) -> Type -> Type
newtype TracedT t w a
The cowriter comonad transformer.
This comonad transformer extends the context of a value in the base comonad so that the value
depends on a monoidal position of type t
.
The ComonadTraced
type class describes the operations supported by this comonad.
Constructors
TracedT (w (t -> a))
Instances
#runTracedT Source
runTracedT :: forall w a t. TracedT t w a -> w (t -> a)
Unwrap a value in the TracedT
comonad.
- Modules
- Control.
Comonad. Env - Control.
Comonad. Env. Class - Control.
Comonad. Env. Trans - Control.
Comonad. Store - Control.
Comonad. Store. Class - Control.
Comonad. Store. Trans - Control.
Comonad. Traced - Control.
Comonad. Traced. Class - Control.
Comonad. Traced. Trans - Control.
Comonad. Trans. Class - Control.
Monad. Cont - Control.
Monad. Cont. Class - Control.
Monad. Cont. Trans - Control.
Monad. Error. Class - Control.
Monad. Except - Control.
Monad. Except. Trans - Control.
Monad. Identity. Trans - Control.
Monad. List. Trans - Control.
Monad. Maybe. Trans - Control.
Monad. RWS - Control.
Monad. RWS. Trans - Control.
Monad. Reader - Control.
Monad. Reader. Class - Control.
Monad. Reader. Trans - Control.
Monad. State - Control.
Monad. State. Class - Control.
Monad. State. Trans - Control.
Monad. Trans. Class - Control.
Monad. Writer - Control.
Monad. Writer. Class - Control.
Monad. Writer. Trans