Matrix library in Haskell