Monads = lazy, effect types = strict?

Wadler, for instance, makes the claim, in "The marriage of effects and monads" (pg. 1), that effects typing systems are usually found in strict languages, whereas monads are usually found in lazy languages. Why is this? Is there a technical reason, or just a difference in cultures between the two camps?

(I have seen others make an even stronger claim, that monads are especially suited for lazy languages, in some sense.)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Asking back

In which lazy language besides Haskell?

Lazy languages have an

Lazy languages have an additional issue with effects, namely sequencing. Monads solve this as well. Similarly, it's been common to do without that in strict languages and so effect systems are a closer fit to the way they've historically been used.

Monads in strict languages

There exists strict languages with monads, Timber is one example.

I've gone with monadic IO in

I've gone with monadic IO in interpreters for a few toy strict languages too, it's easy enough to implement and works fine. Admittedly I'm very much a haskell programmer these days, so it's my natural habitat as it were.

It's what I do in Ocaml, too...

...I habitually use monads to structure effects.

I'm starting to wonder if I should take a more call-by-push-value view of the world, though.

What would be the

What would be the consequences of CBPV?

Types, lots of types...!

One of the effects is that the type structure of the language becomes considerably more intricate -- the distinction between values and computations becomes explicit in the types, and so you can distinguish between the type of integer values, the type of computations producing integers, and the type of thunked computations. The second pair of distinctions is not present in monadic semantics, and corresponds to the fact that cpbv decomposes the monad into a pair of adjoint functors whose composition is the monad. This end up giving you considerable control over things like the order of evaluation.

Thanks for the concise

Thanks for the concise summary! There never seems to be enough time to read everything I'd like to... :-)