0
bmiTell :: => Double -> String
bmiTell bmi
    | bmi <= 18.5 = "You're underweight, you emo, you!"
    | bmi <= 25.0 = "You're supposeldly normal. Pffft, I bet you're ugly!"
    | bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
    | otherwise   = "You are a whale, congratulations!"

这段代码给了我一个错误,“输入'=>'时解析错误”我不知道为什么。有什么帮助吗?谢谢你 !

4

1 回答 1

5

该行:

bmiTell :: => Double -> String

具有符号=>,用于将类约束与包含约束类型的签名分开。但是,您没有任何限制,例如Show a =>. 解决方案?删除它!

bmiTell :: Double -> String
于 2012-05-05T23:45:24.263 回答