I'm having trouble compiling the following:
data Matrix = Matrix [[Float]] deriving (Eq)
aditionMat :: Matrix -> Matrix -> Matrix
aditionMat m1 m2 = Matrix $ zipWith (zipWith (+)) m1 m2
I'm working on defining a custom matrix data type, but the method I made for adding two matrices together won't work.
aditionMat works fine when I give it two [[Float]], but won't compile when I feed it two Matrix.
The error is the following:
Couldn't match expected type [[Float]] with actual type Matrix (for both m1 and m2)
Apologies for the very trivial question but I can't see why it fails