我收到以下错误:
在输入' |'
上解析错误
我的代码:
makeMove :: Player -> Board -> Maybe Board
makeMove p b | hasWinner b == Nothing = getMove p rb ri
where rb = gameTree p b
ri = minimax p rb
ros2int (i' :> ri') = i'
rb2b (b':rbs') = b
getMove p (r:rs) (i:is) = let bs = map rb2b rs
is = map ros2int is
idx = elemIndex (maximum' is) is
res (Nothing) = Nothing
res (Just x) = Just ((bs)!!x)
in res idx
| otherwise = Nothing
但是我认为这通常是由标签干扰引起的,但是我检查过,我只使用了空格,因此不会出现问题。有谁可以帮我解决这个问题?
提前致谢!
祝你好运, Skyfe。
答案 0 :(得分:10)
where
条款应该在所有警卫之后:
fun a b
| one = ...
| oterwise = ...
where ....