unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [zimoun] Re: Viewing derivation output in the store
       [not found] <87r15gcjlu.fsf@gmail.com>
@ 2022-05-02  7:54 ` zimoun
  2022-05-07 22:09   ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: zimoun @ 2022-05-02  7:54 UTC (permalink / raw)
  To: Guix Devel

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 --------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [zimoun] Re: Viewing derivation output in the store
  2022-05-02  7:54 ` [zimoun] Re: Viewing derivation output in the store zimoun
@ 2022-05-07 22:09   ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2022-05-07 22:09 UTC (permalink / raw)
  To: zimoun; +Cc: Guix Devel

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

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

The monad interface predates the file-like stuff in (guix gexp).
The “regular” gexp/file-like interface today is sufficient in a wide
range of cases, such that it’s normally not necessary to use the monadic
interface unless you’re getting into internals or writing a new tool.

Which is not to say that the usability problem must be ignored, but
rather that it should be put in perspective, in particular to better
understand the needs of those who end up struggling with the monadic
interface.

Thoughts?

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-07 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87r15gcjlu.fsf@gmail.com>
2022-05-02  7:54 ` [zimoun] Re: Viewing derivation output in the store zimoun
2022-05-07 22:09   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).