1
votes

I'm a trying to get into Haskell. The Function itself (without pattern matching) works, but with the pattern matching I get this error:

error: parse error on input ‘->’
|
23 | print_is_even ∷ Bool -> String
|

print_is_even ∷ Bool -> String
print_is_even x = if x==True then "Is even" else "Not even"
1
Side note: x==True is redundant; you can replace it with x.duplode

1 Answers

10
votes

Either turn on the UnicodeSyntax extension, or use :: instead of .