[Haskell-cafe] Haskell-Cafe Digest, Vol 217, Issue 16

Bryan Richter b at chreekat.net
Fri Sep 17 18:00:07 UTC 2021


I myself heard "programmable semicolon" sometime after monads had clicked
for me, but I still appreciate it. To answer Tom's question, what these
short single sentences do is explain the *purpose* of monads, which is
really quite obscure at first.

Listing sequential actions one after the other is so intuitive you see it
everywhere. Take baking recipes as one example. Or assembly code. Or poems.

Procedural programming languages let you use the same intuition for
sequencing actions you've been using since you were carving hieroglyphics
into obelisks.

When a Haskeller says, "Monads are great! They let you chain effectful
actions together!" it can take a very long time to understand they actually
mean exactly what they're saying — the usual intuition is that sequencing
actions can't possibly be a real problem, so you go round and round in
circles trying to understand what "effectful" means, what "action" means,
and how these oh-so-important "laws" have anything to do with it.

A programmable semicolon cuts right to the truth: yes, really, functional
programming had to work hard to solve *that* problem.

I can understand why that viewpoint might be long-forgotten by those who
were involved in the effort to solve it. :) And I appreciate that it was
solved in such a general way that it can be applied to so many seemingly
unrelated things! That's the beauty of mathematics!


On Fri, 17 Sep 2021, 20.11 Tom Ellis, <
tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote:

> On Fri, Sep 17, 2021 at 05:02:09PM +0000, Richard Eisenberg wrote:
> > > On Sep 17, 2021, at 3:50 AM, Tom Ellis <
> tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote:
> > >
> > > On Fri, Sep 17, 2021 at 01:43:01PM +0900, Michael Turner wrote:
> > >> I finally got (most of?) what monads really mean for practical
> > >> programming when none other than Simon Peyton-Jones said F# called a
> > >> very similar construct "workflow," a word he likes.
> > >
> > > Was it literally just a single sentence introducing a new word for a
> > > concept that made you "get it"?  Could you elaborate?  This is really
> > > quite remarkable.
> >
> > For me, coming from a mostly Java background (but with a healthy
> > dollop of functional programming thrown in the mix -- but no
> > Haskell), the phrase that unlocked monads was "programmable
> > semicolon".
>
> I'm curious what "unlock" means here.  Do you mean you could
> understand the definition of the monad class after coming across
> "programmable semicolon" but not before?  Or do you mean you
> understood the *purpose* of monads, but not necessarily how one would
> go about implementing them?  Or something else?
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210917/db60e5da/attachment.html>


More information about the Haskell-Cafe mailing list