Syntax extensions: mdo and do...rec

Simon Peyton-Jones simonpj at microsoft.com
Wed Sep 17 09:53:30 EDT 2003


I agree with this. We'll move GHC to implement any consensus.

My own opinion is that
	expr :: = ... | do { stmts }

	stmts :: = .. | rec { stmts }

is the cleanest story.  I guess that we should ensure that

	do rec { stmts }

means what it looks like.

Simon

| -----Original Message-----
| From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org]
On Behalf Of
| nilsson at cs.yale.edu
| Sent: 16 September 2003 18:09
| To: haskell at haskell.org
| Subject: Syntax extensions: mdo and do...rec
| 
| 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
| _______________________________________________
| Haskell mailing list
| Haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell




More information about the Haskell mailing list