[Haskell] simple declarations proposal, was: offside rule question
maeder at tzi.de
Thu Jul 14 03:02:09 EDT 2005
Frederik Eaton wrote:
> main = do
> let a = (map (\x->
> x+1) --*
> [0..9]) --*
> print a
seeing this, I wonder if do-statements (and qualifiers in list
comprehensions) could be easily extended by an alternative for simple
declarations (without mutual recursion and type signatures)
qual -> pat <- exp | "let" decls | exp | (funlhs | pat0) rhs
stmt -> exp ; | pat <- exp ; let decls ; | (funlhs | pat0) rhs ; | ;
These simple declarations could be easily recognised by an equal "=" or
guard "|" sign and distinguished from the "pat <- exp" binding.
It would avoid the above extra indentation!
main = do
a = ...
Has this ever been considered before (and was rejected for some reason)?
More information about the Haskell