[squeak-dev] Monads in Squeak

Tony Garnock-Jones tonyg at leastfixedpoint.com
Mon Aug 1 08:48:02 UTC 2022

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.

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


More information about the Squeak-dev mailing list