Created
June 15, 2016 02:15
-
-
Save seantalts/a559ab62c9a238a0055e17c27957274a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dim mat = (length mat, length (head mat)) | |
subMats mat (height, width) = | |
[trimmed | r <- [0..rows] | |
, c <- [0..columns] | |
, let vertTrimmed = take height (drop r mat) | |
trimmed = map (take width . drop c) vertTrimmed | |
, length trimmed == height | |
, length (head trimmed) == width] | |
where (rows, columns) = dim mat | |
matContains mat p = elem p subs | |
where subs = subMats mat $ dim p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment