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 = ...
    print a

Has this ever been considered before (and was rejected for some reason)?

Cheers Christian
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to