<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Tony,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 1, 2022 at 1:48 AM Tony Garnock-Jones <<a href="mailto:tonyg@leastfixedpoint.com">tonyg@leastfixedpoint.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On the Squeak Slack, @asarch asked "Are there monads in Squeak?"<br>
<br>
My answer was:<br>
<br>
Tricky question. Monads are a kind of design pattern reflecting a formal <br>
mathematical structure. Languages with static type systems are able to <br>
enforce some (but usually not all) of the mathematical monad laws; in <br>
Smalltalk, the type system is not strong enough to enforce any monad <br>
laws. So, monads do appear in Smalltalk in two ways: implicitly, in that <br>
theoretically every expression is "in the IO monad"; and explicitly, in <br>
examples such as the API on class Promise. Squeak's Promise class <br>
implements monadic operations and honours the monad laws.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">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.</div><div class="gmail_default" style="font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">So TL;DR is "yes, but..." :-)<br>
<br>
Cheers,<br>
   Tony<br>
</blockquote></div><div><br></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>