Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

haskell

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"
like image 250
der_marvin_ Avatar asked Apr 30 '26 14:04

der_marvin_


1 Answers

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

like image 129
Joseph Sible-Reinstate Monica Avatar answered May 02 '26 07:05

Joseph Sible-Reinstate Monica



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!