[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
REPL meta-commands
From: |
Ludovic Courtès |
Subject: |
REPL meta-commands |
Date: |
Sat, 16 Aug 2014 11:14:42 +0200 |
User-agent: |
Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux) |
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’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- REPL meta-commands,
Ludovic Courtès <=