[Haskell-beginners] parse error

informationen informationen at gmx.de
Sun Oct 4 10:11:35 EDT 2009


Hi,

the "| True" part is wrong. It should read:

is_even n   | n `mod` 2 == 0 = True
             | otherwise = False. 

Kind regards

Chris 

>Hi,
>     This is a function that returns true if divisible by 2. But it keeps
>telling me parse error on input | . What is wrong here.
>is_even n   | mod n 2 == 0
>                 | True
> 
>Not sure if I need another statement for false
> 
>John

>_______________________________________________
>Beginners mailing list
>Beginners at haskell.org
>http://www.haskell.org/mailman/listinfo/beginners


More information about the Beginners mailing list