[Haskell-cafe] Parse error

Daniel Fischer daniel.is.fischer at web.de
Sun Jan 17 05:38:05 EST 2010


Am Sonntag 17 Januar 2010 11:33:45 schrieb Andrew Coppin:
> Tony Morris wrote:
> > No, but there's a specific reason why GHC consistently refuses to
> > accept your perfectly unreasonable code snippet :)
>
> She sells csh on the sea shore. :-)
>
> > 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
>
> Urg, but that's *ugly*. Is there no way I can reduce the amount of
> indentation to something more reasonable?


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

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

  print xs

That better?


More information about the Haskell-Cafe mailing list