[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Parse error

Subject: Re: [Haskell-cafe] Parse error
From: Tony Morris
Date: Sun, 17 Jan 2010 20:23:33 +1000
No, but there's a specific reason why GHC consistently refuses to accept
your perfectly unreasonable code snippet :)

GHC accepts the following perfectly reasonable code snippet:

main = do
 putStrLn "Line 1"
 putStrLn "Line 2"

 let xs = do x <- [1..10]
             y <- [1..10]
             return (x+y)

 print xs

Andrew Coppin wrote:
> Is there a specific reason why GHC consistently refuses to accept the
> following perfectly reasonable code snippet?
>
> main = do
>  putStrLn "Line 1"
>  putStrLn "Line 2"
>
>  let xs = do
>    x <- [1..10]
>    y <- [1..10]
>    return (x+y)
>
>  print xs
>
> No matter which way I rearrange this, it *insists* that there's a
> parse error. This is very frustrating, given that it's utterly clear
> what I want...
>
> _______________________________________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

-- 
Tony Morris
http://tmorris.net/


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>