Re: [Haskell-cafe] Nested monadic monoids via Traversable?

2013-10-13 Thread Hans Höglund
If anyone is interested, Typeclassopedia pointed me to Composing Monads by Jones and Duponcheel (1993), which contains exactly my implementation along with some other nice patterns for composing Monads via Traversable.sequence (called swap in the paper) and related operators. It would be

[Haskell-cafe] Nested monadic monoids via Traversable?

2013-10-10 Thread Hans Höglund
I have been experimenting with compositions of monads carrying associated monoids (i.e. Writer-style) and discovered the following pattern: -- {-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable,