guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[zimoun] Re: Viewing derivation output in the store


From: zimoun
Subject: [zimoun] Re: Viewing derivation output in the store
Date: Mon, 02 May 2022 09:54:55 +0200

Hum, I guess, I have screwed up the reply’s header… Anyway!

-------------------- Start of forwarded message --------------------
From: zimoun <zimon.toutoune@gmail.com>
To: Ludovic Courtès <ludo@gnu.org>
Subject: Re: Viewing derivation output in the store
Date: Fri, 29 Apr 2022 11:41:17 +0200

Hi,

On Thu, 28 Apr 2022 at 09:30, Ludovic Courtès <ludo@gnu.org> wrote:

> I guess we could do that, though it seems to me like a marginal
> improvement over ‘mbegin’ and ‘mlet’.

What do you mean by marginal?


Because the current pattern,

--8<---------------cut here---------------start------------->8---
(with-store store
  (run-with-store store
    (mlet* %store-monad
        ((drv (gexp->derivation "myderivation" test-gexp))
         (output -> (derivation->output-path drv)))
      (mbegin %store-monad
        (built-derivations (list drv))
        (return (format #t "~a~%" output))))))
--8<---------------cut here---------------end--------------->8---

is really cumbersome, i.e.,

        (with-store store
          (run-with-store store

        (mlet* %store-monad
            ()
          (mbegin %store-monad

when you compare with this proposal,

--8<---------------cut here---------------start------------->8---
(mdo %store-monad
  (drv <- (gexp-derivation "myderivation" test-gexp))
  (output <- (return (derivation->output-path drv)))
  (built-derivations (list drv))
  (return (format #t "~a~%" output)))
--8<---------------cut here---------------end--------------->8---


First, monadic style is not popular among Lispers.  Second, the current
monadic style is hard to grasp.  Consequence, few people dive* in monadic
things.

For sure, it will not revolutionize but it would bridge various
materials about monadic things.

Therefore, if nothing is preventing us from having do notation à la
Haskell, we are avoiding success at all costs (as the Haskell’s slogan
says ;-)).


Cheers,
simon



*few people dive: I remember some discussion with Guixers at FOSDEM some
 time ago, that’s why I wrote an attempt of explanations,

    <https://simon.tournier.info/posts/2021-02-03-monad.html>

and such improvement would even simplify «the Store Monad» concept,
IMHO.
-------------------- End of forwarded message --------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]