Monads with Join() instead of Bind()

Without plumbing the depths of metaphor, might I suggest to read a typical monad m as “strategy to produce a”, so the type m value is a first class “strategy to produce a value”. Different notions of computation or external interaction require different types of strategy, but the general notion requires some regular structure to … Read more

Does Haskell have tail-recursive optimization?

Haskell uses lazy-evaluation to implement recursion, so treats anything as a promise to provide a value when needed (this is called a thunk). Thunks get reduced only as much as necessary to proceed, no more. This resembles the way you simplify an expression mathematically, so it’s helpful to think of it that way. The fact … Read more