In this script,
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))
I wonder why there is a
parse error on input "where"
Thanks for your advance!
con1is on the wrong indentation level for thewhereblock. You need to ensure that the code you've pasted in looks like the code in your editor so we can see what's misaligned.==instead of=in the line above.