Passing a matrix from C to Haskell