unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Guix Devel <guix-devel@gnu.org>
Subject: [zimoun] Re: Viewing derivation output in the store
Date: Mon, 02 May 2022 09:54:55 +0200	[thread overview]
Message-ID: <87czgwbc8g.fsf@gmail.com> (raw)
In-Reply-To: 87r15gcjlu.fsf@gmail.com

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	other threads:[~2022-05-02  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r15gcjlu.fsf@gmail.com>
2022-05-02  7:54 ` zimoun [this message]
2022-05-07 22:09   ` [zimoun] Re: Viewing derivation output in the store Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czgwbc8g.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).