在此脚本中,
data Move = Rock | Paper | Scissor
deriving (Show,Eq)
lose Rock = Scissor
lose Paper = Rock
lose _ = Paper
data Result = Win | Draw | Lose
deriving (Show,Eq)
outcome :: Move -> Move -> Result
outcome x y
| con1 == Win
where
con1 = (y==(lose x))
我想知道为什么会有
parse error on input "where"
感谢您的进步!
答案 0 :(得分:4)
当您使用where
==
时,可能需要=
。