* guix/monads.scm (package-file): Add #:target keyword parameter and
honor it.
(package->cross-derivation): New procedure.
* tests/monads.scm ("package-file + package->cross-derivation"): New test.
* doc/guix.texi (The Store Monad): Update 'package-file' documentation.
Add 'package->cross-derivation'.
* 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: Unexport 'lower-inputs' and 'derivation-expression'.
(text-file*): Add comment about the switch to 'gexp->derivation'.
(lower-inputs): Add comment about its doom.
(derivation-expression): Likewise.
* guix/gexp.scm (lower-inputs*): Rename to...
(lower-inputs): ... this. Update callers.
* tests/monads.scm (derivation-expression): New procedure.
* doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of
'derivation-expression'. Remove documentation of
'derivation-expression'.
* guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are
properly expanded.
* tests/guix-build.sh: Use 'gexp->derivation' instead of
'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'.
* guix/monads.scm (text-file*): New procedure.
* tests/monads.scm ("text-file*"): New test.
* doc/guix.texi (The Store Monad): Change example since the previous one
would erroneously fail to retain a reference to Coreutils. Document
'text-file*'.
* guix/monads.scm (<monad>): Turn in a raw SRFI-9 record type.
(define-monad): New macro.
(with-monad): Add a case for when MONAD is a macro.
(identity-return, identity-bind, store-return, store-bind): Inline.
(%identity-monad, %store-monad): Use 'define-monad'.
* tests/monads.scm ("monad?"): New test.
* guix/monads.scm: New file.
* tests/monads.scm: New file.
* Makefile.am (MODULES): Add guix/monads.scm.
(SCM_TESTS): Add tests/monads.scm.
* doc/guix.texi (The Store Monad): New node.
(The Store): Reference it.