Imagine if bar was a toplevel function

bar = case foo of
True -> " Foo";
False -> "Bar";

Keep in mind that indentation level starts at the function name, not at the
let keyword.


On Thu, Oct 3, 2013 at 2:31 PM, Corentin Dupont
<corentin.dup...@gmail.com>wrote:

> 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
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to