blak :: Sudoku → [Pos]
blak (Sudoku su) = [ fst x | x ← posSud , isBlank (snd x) ]
where
isBlank Nothing = True
isBlank _ = False
posSud = zip ixPos (concat su)
ixPos = zip ixRows ixCols
ixCols = concat (replicate 9 [0..8])
ixRows = [floor (x / 9) | x ← [0..81]]
{-
Property that states that all cells in the blanks list are actually blank
-}
prop_blak_pos :: Sudoku → Bool
prop_blak_pos sud = (rows sud) !! (fst pair) !! (snd pair) ≡ Nothing
where pair = blak sud
But I get the following error message
could't match expected type '(a, b)' against inferred type '[Pos]'
in the first argument 'fst'' namley pair and second of '(!!)' namley fst pair
in the first argument of '(rows) bankey ('rows sud)'
How can I fix this problem, im new at haskell.


Sign In
Create Account

Back to top









