1
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

1
  • 2
    you can't skip the then keyword in the if ... then ... else ... expression. Commented Oct 22, 2018 at 1:38

1 Answer 1

6
if incrementBid <= length hand
    incrementBid
else -- <- error occurs on this line 
    incrementBid - 2

then is not optional and it is missing in this block.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.