guix-patches
[Top][All Lists]
Advanced

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

[bug#76485] [PATCH] gexp: ‘with-parameters’ properly handles ‘%graft?’.


From: Ludovic Courtès
Subject: [bug#76485] [PATCH] gexp: ‘with-parameters’ properly handles ‘%graft?’.
Date: Tue, 04 Mar 2025 23:18:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hey David,

David Elsing <david.elsing@posteo.net> skribis:

> Ah yes, but I don't think a generic solution is needed at this point, as
> only the state monad is used in Guix. :)
> I also tried to find a general way to apply `with-fluids*' for monads in
> `mparameterize' and then noticed it might not make much sense.

Yeah, I agree.

>> The core of the problem here is that (guix monads), to a large extent,
>> addresses problems already addressed by other Scheme constructs such as
>> parameters/fluids, but in an incompatible way.  So really,
>> ‘mparameterize’ and the many commits that fixed interactions between
>> ‘%current-system’ & co. and the monad are really band aid.
>
> I don't find the combination of the state monad and parameters so bad,
> and the idea of using the store monad to accumulate what to build is
> quite nice.

That’s right, glad you like it.  :-)

Overall I think the initial motivation for having monads (the “store”
monad in particular) still makes sense.  It’s the integration that
turned out to be clumsier than expected.

> To me the combination with prompts is a bit confusing though, it might
> be clearer to have continuations as part of the store monad.

I’m not sure.  In a way, file-like objects achieve something similar to
the store monad, but in a more “Schemey” way.  Likewise, Scheme has
delimited continuations, which is dynamic in nature; in other languages
one would use a monad for that but in Scheme it would be questionable as
it wouldn’t play well with other features (first of all by
“contaminating” non-monadic procedures).

> Oh, maybe you didn't see my previous patch where I specialized
> `mcall-with-parameters' and `mparameterize' to the state monad, I only
> sent it to Debbugs. I updated the patch and used your workaround for
> avoiding using `with-fluids*' by setting and later restoring the
> parameters.

I actually did see it but I was in a state of confusion.  :-)

Thanks for your patience and for your work!

Ludo’.





reply via email to

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