输入'='上的解析错误

时间:2014-03-12 21:32:25

标签: haskell

我一直收到这条消息,我做错了什么?

quadrant :: Float -> Float -> Quadrant
quadrant x y
    |x = 0 && y = 0 = Origin
    |x > 0 && y = 0 = X_ Axis_Positive
    |x > 0 && y > 0 = Quadrant_1
    |x = 0 && y > 0 = Y_ Axis_Positive
    |x < 0 && y > 0 = Quadrant_2
    |x < 0 && y = 0 = X_ Axis_Negative
    |x < 0 && y < 0 = Quadrant_3
    |x = 0 && y < 0 = Y_ Axis_Negative
    |x > 0 && y < 0 = Quadrant_4
    |otherwise = error "Program error: Non-Exhaustive guards in function: quadrant"

1 个答案:

答案 0 :(得分:7)

测试相等性的运算符是==,其中=是语言语法的一部分。