prob-fx-0.1.0.2: A library for modular probabilistic modelling
Safe HaskellNone
LanguageHaskell2010

Effects.Writer

Description

Writer effect.

Synopsis

Documentation

data Writer w a where Source #

Writer effect for writing to a strean w

Constructors

Tell

Write to a stream w

Fields

  • :: w

    value to write

  • -> Writer w ()
     

tell :: Member (Writer w) es => w -> Prog es () Source #

Wrapper for Tell

tellM :: Member (Writer w) es => w -> Model env es () Source #

Wrapper for Tell inside Model

handleWriter Source #

Arguments

:: forall w es a. Monoid w 
=> Prog (Writer w ': es) a 
-> Prog es (a, w)

(output, final stream)

Handle the Writer effect for a stream w

handleWriterM Source #

Arguments

:: Monoid w 
=> Model env (Writer w ': es) a 
-> Model env es (a, w)

(output, final stream)

Handle the Writer effect inside a Model