Given the following,
module Foo where
main = do
let foo = case 0 of
0 -> 4
return ()
GHC insists that I have a syntax error:
Make.hs:5:5: parse error (possibly incorrect indentation)
Why? I've used Haskell for a while, and it looks correct to me.
Multiline expressions in do syntax must be indented beyond the variable name:
main = do
let foo = case 0 of
0 -> 4
return ()
is ok but
main = do
let foo = case 0 of
0 -> 4
return ()
is not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With