monads: Fix 'mapm' so that effects happen from left to right.
authorLudovic Courtès <ludo@gnu.org>
Sat, 12 Jul 2014 15:16:36 +0000 (17:16 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sat, 12 Jul 2014 21:17:53 +0000 (23:17 +0200)
commitf62435e2868f5db15cc2f31300630c8ec873dd58
tree4c48f36fafd1c02b5d65fb92fd257e3bd0c78dc0
parentc2150d9acece1dcaf54b3183254db4f83a992523
monads: Fix 'mapm' so that effects happen from left to right.

* guix/monads.scm (mapm): Don't reverse LST, so that items are processed
  from left to right.  Bind the result of 'foldm' and reverse it.
* tests/monads.scm ("sequence"): Change 'frob' so it performs its side
  effect within an 'mlet' body.  Adjust call accordingly.
guix/monads.scm
tests/monads.scm