Syntax extensions: mdo and do...rec

nilsson at cs.yale.edu nilsson at cs.yale.edu
Tue Sep 16 14:09:23 EDT 2003


Dear Haskellers,

A questions.

The do-notation has been extended to support recursive bindings by using
the "mdo" keyword. The do-notation has also been extended (through Ross
Patterson's preprocessor, and now also GHC) to support programming
with arrows. In that context, a different syntax, using the keyword "rec",
is used to enable recursive bindings.

It seems somewhat confusing to have distinct syntax for what appears
to be very closely related purposes. Would it be possible have just a
single syntactic extension to enable recursive bindings in either context?
(Presumably the "rec" version is a bit more flexible in that it can be
applied to a subset of the bindings in a do-construct.)

Best regards,

/Henrik

-- 
Henrik Nilsson
Yale University
Department of Computer Science
nilsson at cs.yale.edu


More information about the Haskell mailing list