all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* REPL meta-commands
@ 2014-08-16  9:14 Ludovic Courtès
  0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2014-08-16  9:14 UTC (permalink / raw)
  To: guix-devel

Hi from Munich!

I committed yesterday the (guix monad-repl) module, which adds
meta-commands to the Guile REPL (which I needed for demos of my talk.)
Quoth the manual:

--8<---------------cut here---------------start------------->8---
   Note that the ‘(guix monad-repl)’ module extends Guile’s REPL with
new “meta-commands” to make it easier to deal with monadic procedures:
‘run-in-store’, and ‘enter-store-monad’.  The former, is used to “run” a
single monadic value through the store:

     scheme@(guile-user)> ,run-in-store (package->derivation hello)
     $1 = #<derivation /gnu/store/…-hello-2.9.drv => …>

   The latter enters a recursive REPL, where all the return values are
automatically run through the store:

     scheme@(guile-user)> ,enter-store-monad
     store-monad@(guile-user) [1]> (package->derivation hello)
     $2 = #<derivation /gnu/store/…-hello-2.9.drv => …>
     store-monad@(guile-user) [1]> (text-file "foo" "Hello!")
     $3 = "/gnu/store/…-foo"
     store-monad@(guile-user) [1]> ,q
     scheme@(guile-user)>

Note that non-monadic values cannot be returned in the ‘store-monad’
REPL.
--8<---------------cut here---------------end--------------->8---

Feedback welcome!

Ludo’.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-16  9:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-16  9:14 REPL meta-commands Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.