Hello!

Hugo Buddelmeijer via <[email protected]> skribis:

> My functional programming is a bit rusty, and Guix relies heavily on
> the store monad.  And there are several ways to interact with it,
> e.g. with-store, with-monad, run-with-store, mlet, %store-monad.

Of these, ‘with-store’ is an outlier: it’s exported by (guix store) and
has nothing to do with monads; it merely opens a connection to the
daemon.

For the rest, ‘run-with-store’ is something that is typically only
called from the outermost part of a program—when you want to “exit the
monad”, as the manual section says (likewise, ‘with-store’ is typically
used only once at the top level, to open a connection that the rest of
the program will use).

A good tutorial is
<https://guix.gnu.org/en/blog/2023/dissecting-guix-part-2-the-store-monad/>,
written by “unmatched paren”.

HTH!

Ludo’.

Reply via email to