[Haskell-cafe] indentation with let and do

Corentin Dupont corentin.dupont
Thu Oct 3 18:31:18 UTC 2013


Hi the list,
why do this function doesn't compile (parse error):

test :: Bool -> IO ()
test foo = do
   let bar = case foo of
       True ->  "Foo";
       False -> "Bar"
   return ()

while this one does (just adding one space in front of True and False):

test :: Bool -> IO ()
test foo = do
   let bar = case foo of
        True ->  "Foo";
        False -> "Bar"
   return ()


Thanks!!
Corentin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131003/2a1d0b8b/attachment.htm>



More information about the Haskell-Cafe mailing list