macro_rules! wrdo {
(pure $e:expr ) => { ... };
(let $v:ident = $e:expr ; $($rest:tt)*) => { ... };
(_ <- $monad:expr ; $($rest:tt)* ) => { ... };
($v:ident <- pure $e:expr ; $($rest:tt)* ) => { ... };
($v:ident <- $monad:expr ; $($rest:tt)* ) => { ... };
($monad:expr ) => { ... };
}
macro for a Writer monad that holds a pair (A, Monoid)
The logger type (a local Monoid instance) can be established by using a tell_...()
generator
or by constraining the type of the macro result.