avoidHookRule :: Int -> [Cards] -> Int
avoidHookRule initialBid hand = if decrementBid /= 0
then
decrementBid
else
if incrementBid <= length hand
incrementBid
else -- <- error occurs on this line
incrementBid - 2
where incrementBid = initialBid + 1
decrementBid = initialBid - 1
正如标题所述,我的else语句出现错误。为什么会这样呢?我如何解决它?谢谢
答案 0 :(得分:6)
if incrementBid <= length hand
incrementBid
else -- <- error occurs on this line
incrementBid - 2
then
不是可选的,并且在此块中丢失。