|Version 2 (modified by nhn@…, 11 years ago) (diff)|
Recursive Do Notation
An extended form of do notation allowing feedback for monads in the MonadFix class.
There are connections to the proposed syntactic support for Arrows using an extended form of do-noation. In particular, the Arrowsextension has its own syntax for recursive bindings/feedback. It would clearly be preferable if there was only one variant of recursive do. Even if the Arrows extensions are not adopted, it does offer a different explicit syntax for recursive bindings through the keyword rec that arguably is a bit more suggestive of its meaning than mdo. Conversely, if it is decided to go for implicit recursion, then it would seem reasonable to opt for the same in the case of Arrows, if possible. If not, then that might be another argument against implicit recursion.
- makes programs much more readable that the equivalent forms using mfix.
- not backward compatible with Haskell 98, unless a different keyword is used: using a variable before it is bound is treated as recursion.
- a dependency analysis is required to determine the semantics.