Skip to content

Instantly share code, notes, and snippets.

@wridgers
Created June 9, 2011 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wridgers/1015826 to your computer and use it in GitHub Desktop.
Save wridgers/1015826 to your computer and use it in GitHub Desktop.
det :: (Integral a) => [[a]] -> a
det matrix
| rows /= cols = -1
| rows == cols = 1
where rows = length (matrix)
cols = length (matrix !! 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment