Reputation: 3
Error is on the line scoreH h b n
:
parse error (possibly incorrect indentation or mismatched brackets)
When I indent it by one space more (not in line with the function definition) I get
parse error on input =.
scoreH :: Hand->DomBoard->Int->(Bool,[(Dom,End)]
scoreH h b n =
let
lPlays = leftdrops h b
rPlays = rightdrops h b
lPoss = leftScoreH lPlays b n
rPoss = rightScoreH rPlays b n
in
if (length(lPoss) /= 0 || length(rPoss) /= 0) then (True,(lPoss++rPoss)) else (False,[(_,_)])
rightScoreH :: Hand->DomBoard->Int->[(Dom,End)]
rightScoreH [] _ _ = []
rightScoreH (h:t) b n
|scoreDom h R b == n = (h,R):rightScoreH t b n
|otherwise = rightScoreH t b n
leftScoreH :: Hand->DomBoard->Int->[(Dom,End)]
leftScoreH [] _ _ = []
leftScoreH (h:t) b n
|scoreDom h L b == n = (h,L):leftScoreH t b n
|otherwise = leftScoreH t b n
Upvotes: 0
Views: 74
Reputation: 120751
Actually this problem has nothing to do with indentation at all, it's right there in the first line: the signature is missing a closing paren.
(Bool,[(Dom,End)] )
This would have been more obvious if you had left a bit more space in there, like
scoreH :: Hand -> DomBoard -> Int -> (Bool, [(Dom, End)]
⚡ ⚡ clearly not closing
Upvotes: 7