View Source WriterMonad (Chorex v0.4.3)
Makes it easy to do operations on code and track gathered data.
Summary
Functions
Haskell-like do
notation for monads.
Types
{expression, [callback_spec], [fresh_functions]}
Functions
@spec bind({a, [b], [d]}, (a -> {c, [b], [d]})) :: {c, [b], [d]}
when a: var, b: var, d: var, c: var
@spec fmap({a, [b], [c]}, (a -> d)) :: {d, [b], [c]}
when a: var, b: var, c: var, d: var
Haskell-like do
notation for monads.
iex> import WriterMonad iex> monadic do ...> thing1 <- return(5) ...> thing2 <- {thing1 + 2, ["foo"], [:zoop]} ...> thing3 <- {thing1 + thing2, ["bar"], [:quux]} ...> return thing3 ...> end {12, ["bar", "foo"], [:zoop, :quux]}