Work in haskell, found odd behavior, split it into bare bones
It works
a :: Bool a = case True of True -> True False -> False
But when I try
b :: IO Bool b = do let b' = case True of True -> True False -> False return b'
I get
ghci>:l test.hs [1 of 1] Compiling Main ( test.hs, interpreted ) test.hs:16:14: parse error on input '->' Failed, modules loaded: none.
So I'm trying
c :: IO Bool c = do let c' = case True of True -> True False -> False return c'
And it works.
What? What for? Why do I need extra indentation in this case? I canβt find anything about this, probably because these keywords are so short and common in everyday language. Is there any specification that explains this behavior?
source share