cleff-0.3.1.0: Fast and concise extensible effects
Copyright(c) 2021 Xy Ren
LicenseBSD3
Maintainerxy.r@outlook.com
Stabilityexperimental
Portabilitynon-portable (GHC only)
Safe HaskellTrustworthy
LanguageHaskell2010

Cleff.Output

Description

 
Synopsis

Effect

data Output o :: Effect where Source #

An effect that is capable of producing outputs, for example writing to a log file or an output stream.

Constructors

Output :: o -> Output o m () 

Operations

output :: Output o :> es => o -> Eff es () Source #

Produce an output value.

Interpretations

outputToListState :: Eff (Output o ': es) ~> Eff (State [o] ': es) Source #

Run an Output effect by accumulating a list. Note that outputs are being prepended to the head of the list, so in many cases you would want to reverse the result.

outputToWriter :: (o -> o') -> Eff (Output o ': es) ~> Eff (Writer o' ': es) Source #

Run an Output effect by translating it into a Writer.

ignoreOutput :: Eff (Output o ': es) ~> Eff es Source #

Ignore outputs of an Output effect altogether.

runOutputEff :: (o -> Eff es ()) -> Eff (Output o ': es) ~> Eff es Source #

Run an Output effect by performing a computation for each output.

mapOutput :: Output o' :> es => (o -> o') -> Eff (Output o ': es) ~> Eff es Source #

Transform an Output effect into another one already in the effect stack, by a pure function.

Since: 0.2.1.0

bindOutput :: Output o' :> es => (o -> Eff es o') -> Eff (Output o ': es) ~> Eff es Source #

Transform an Output effect into another one already in the effect stack, by an effectful computation.

Since: 0.2.1.0