从Bool到String匹配输入'->'模式的Haskell解析错误

问题描述 投票:0回答:1

我正在尝试进入Haskell。函数本身(没有模式匹配)可以工作,但是在模式匹配的情况下,我会收到此错误:

错误:解析输入'->'时的错误|23 | print_is_even∷布尔->字符串|

print_is_even ∷ Bool -> String
print_is_even x = if x==True then "Is even" else "Not even"
haskell
1个回答
1
投票

打开UnicodeSyntax扩展名,或使用::代替

© www.soinside.com 2019 - 2024. All rights reserved.