[Haskell-cafe] MonadFix wiki confusion

Samuel Rødal srodal at gmail.com
Sun Oct 18 14:40:19 UTC 2015


Hello,

the MonadFix wiki at https://wiki.haskell.org/MonadFix has a statement
that I feel is a bit misleading.

In section "2.2 Lazy algorithm interleaved with effects", it claims
that making the BTree data structure strict doesn't cause endless
recursion.

Well, that's true, but that's just because rep_x_sum returns a tuple
containing the BTree and the summed values of the current subtree, and
the tuple is lazily constructed - postponing the construction of the
tree value. So highlighting the fact that the function still works
when the BTree structure is made strict is kind of a red herring.

Maybe the confusion could be avoided by removing the part about making
BTree strict, or adding a note about the tuple still ensuring lazy
construction?

--
Samuel


More information about the Haskell-Cafe mailing list