Opened 5 years ago

Closed 5 years ago

#7157 closed feature request (wontfix)

'let' keyword optional in do notation

Reported by: Oblosys Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1-rc1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Would it be possible to make the 'let' keyword in a do block optional? So instead of

do ...
   let x = exp1
       y = exp2
   z <- exp3

you could simply write

do ...
   x = exp1
   y = exp2
   z <- exp3    

Where each sequence of let-less bindings is put in a separate binding group. I'm no parsing wizard, but I couldn't come up with any situations in which this would cause ambiguity. To me, the let-less version is easier on the eyes, more consistent with <- bindings, and also makes it less of a hassle to move stuff around.

The above probably also holds for list/monad comprehensions, but the explicit let has never really bothered me there.

I've also posted the idea on Haskell cafe:

Change History (1)

comment:1 Changed 5 years ago by igloo

difficulty: Unknown
Resolution: wontfix
Status: newclosed

Thanks for the suggestion.

However, looking at this proposal seems to me to make the language more complex (in particular, which bindings share a scope is less transparent), for little or no gain, so I'm closing as wontfix.

Note: See TracTickets for help on using tickets.