[squeak-dev] Monads in Squeak

Eliot Miranda eliot.miranda at gmail.com
Wed Aug 3 22:17:45 UTC 2022

Hi Tony,

On Mon, Aug 1, 2022 at 1:48 AM Tony Garnock-Jones <tonyg at leastfixedpoint.com>

> On the Squeak Slack, @asarch asked "Are there monads in Squeak?"
> My answer was:
> Tricky question. Monads are a kind of design pattern reflecting a formal
> mathematical structure. Languages with static type systems are able to
> enforce some (but usually not all) of the mathematical monad laws; in
> Smalltalk, the type system is not strong enough to enforce any monad
> laws. So, monads do appear in Smalltalk in two ways: implicitly, in that
> theoretically every expression is "in the IO monad"; and explicitly, in
> examples such as the API on class Promise. Squeak's Promise class
> implements monadic operations and honours the monad laws.

I'd love to read a definition of the monad laws in plain English.  I think
I understand promises perfectly well.  I've never understood what a monad
is.  I'm unable to think algebraically very effectively but can think
visually (for example I didn't understand the fourier transform
algebraically (the double integral formulation), but understand it
perfectly well as an infinite set of infinite integrals of the products of
a sine wave with an arbitrary waveform (itself composed of sine waves)).
So if you can explain monads without recourse to algebra (but as much
recourse to Smalltalk as you like) then you have my full attention.

So TL;DR is "yes, but..." :-)
> Cheers,
>    Tony

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220803/1dfae4fa/attachment.html>

More information about the Squeak-dev mailing list