fused-effects-1.1.1.3: A fast, flexible, fused effect system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Carrier.Trace.Returning

Description

A carrier for the Trace effect that aggregates and returns all traced values.

Since: 1.0.0.0

Synopsis

Trace carrier

runTrace :: Functor m => TraceC m a -> m ([String], a) Source #

Run a Trace effect, returning all traces as a list.

runTrace (pure a) = pure ([], a)
runTrace (trace s) = pure ([s], ())

Since: 1.0.0.0

newtype TraceC m a Source #

Since: 1.0.0.0

Constructors

TraceC (WriterC (Endo [String]) m a) 

Instances

Instances details
MonadTrans TraceC Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

lift :: Monad m => m a -> TraceC m a #

MonadFail m => MonadFail (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

fail :: String -> TraceC m a #

MonadFix m => MonadFix (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

mfix :: (a -> TraceC m a) -> TraceC m a #

MonadIO m => MonadIO (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

liftIO :: IO a -> TraceC m a #

(Alternative m, Monad m) => Alternative (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

empty :: TraceC m a #

(<|>) :: TraceC m a -> TraceC m a -> TraceC m a #

some :: TraceC m a -> TraceC m [a] #

many :: TraceC m a -> TraceC m [a] #

Monad m => Applicative (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

pure :: a -> TraceC m a #

(<*>) :: TraceC m (a -> b) -> TraceC m a -> TraceC m b #

liftA2 :: (a -> b -> c) -> TraceC m a -> TraceC m b -> TraceC m c #

(*>) :: TraceC m a -> TraceC m b -> TraceC m b #

(<*) :: TraceC m a -> TraceC m b -> TraceC m a #

Functor m => Functor (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

fmap :: (a -> b) -> TraceC m a -> TraceC m b #

(<$) :: a -> TraceC m b -> TraceC m a #

Monad m => Monad (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

(>>=) :: TraceC m a -> (a -> TraceC m b) -> TraceC m b #

(>>) :: TraceC m a -> TraceC m b -> TraceC m b #

return :: a -> TraceC m a #

(Alternative m, Monad m) => MonadPlus (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

mzero :: TraceC m a #

mplus :: TraceC m a -> TraceC m a -> TraceC m a #

Algebra sig m => Algebra (Trace :+: sig) (TraceC m) Source # 
Instance details

Defined in Control.Carrier.Trace.Returning

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (TraceC m) -> (Trace :+: sig) n a -> ctx () -> TraceC m (ctx a) Source #

Trace effect