guix-devel
[Top][All Lists]
Advanced

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

Re: Struggling to write Dissecting Guix, Part 2


From: zimoun
Subject: Re: Struggling to write Dissecting Guix, Part 2
Date: Wed, 25 Jan 2023 10:58:32 +0100

Hi,

On Wed, 25 Jan 2023 at 07:12, "(" <paren@disroot.org> wrote:

> I've been struggling to write Part 2 of Dissecting Guix; I'm just not sure 
> where to start to
> explain monads.

Here my attempt to explain monads using Guile:

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

My aim was to provide the “intuition” of the concept.  Therefore, I have
tried to explain the monad concept using as simple as possible other
concepts and in the same time I tried to avoid the “monad fallacy” [2].
(summarized by «Monads are Like Burritos» ;-)))


> It's hard for a variety of reasons, those being that:
>
>   - Guile has no type system, so you can't express monads in terms of types

I do not think the concept of monad is related to the type system but
instead it appears to me related to the composition.


>   - Guix doesn't implement very many monads (only state, identity, and 
> store), so it's
>     difficult to explain with a simpler monad, as there are no simpler monads

In [1], I am using the simple monads: list and maybe.

Their implementation is poor but they bring the concept to the table.
Well, I planned to use this introduction of the concepts to then write
another post about the state monad – which is the only we are really
interested in. ;-)


>   - Guix doesn't have functors or monoids either, so it's hard to 
> "progressively" explain
>     first functors, then monoids, then monads

I think monad can be introduced using the well-known ’map’ which uses
functor without digging in too much details.


>  - Monads are just difficult in general :P

Well, from my point of view, it is hard because the concept appears
difficult at first then after the oohh moment it becomes hard to explain
without using the concept itself.  IMHO, it is well summarized in this
post:

2: 
https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/

Cheers,
simon



reply via email to

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