2

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
  • 7
    Side note: x==True is redundant; you can replace it with x. Commented Apr 1, 2020 at 13:42

1 Answer 1

9

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.