I have written this property check in haskell:
prop_XY (x,y) sud = ((!!) (rows (sud)) x) !! y
and i need to define this locally, any suggestions on how to do it as i am clueless how to do it?
EDIT
So this is the two prop functions i have, and i need to define the second one locally.
-- Check update function
prop_update (x,y) sud n = prop_XY (x',y') (update sud (x',y') n) == n
where x' = x `mod` 9
y' = y `mod` 9
-- helper to find specific value
prop_XY (x,y) sud = ((!!) (rows (sud)) x) !! y
If I understand you correctly, you can use a
where
clause:See http://learnyouahaskell.com/syntax-in-functions#where for more information.