Why am I getting a parse error for "else" in Haskell [duplicate]
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
As the title says I get the error on my else statement. Why is this happening? How do I fix it? Thank you
Solution 1:
if incrementBid <= length hand
incrementBid
else -- <- error occurs on this line
incrementBid - 2
then
is not optional and it is missing in this block.