You have got as far as
createMatrix (x,y) z = {-TODO-}
The obvious next step is
createMatrix (x,y) z = Mat ( {-TODO-} , {-TODO-} )
Why should this be obvious?
- Your function gives back a value of type
Matrix a
; this has only one constructor,Mat
: so that is what that value must start with. - The
Mat
constructor take a single value, a pair. We don't have a pair of the correct type to hand, so we will have to make one. Again, there is only a single constructor,( , )
, so that's what we use.
Importantly, I have done this just by following the types (and assuming you don't have any helper functions ready to call).