Module
Control.Comonad.Traced.Class
- Package
- transformers
- Repository
- purescript/purescript-transformers
This module defines the ComonadTraced
type class and its instances.
#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.
- 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