Haskell parse error on input ‘->’ pattern matching from Bool to String

Viewed 111

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 Answers

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

Related