As an exercise for college, I was asked to create a program to test if a matrix is higher triangular. The type of the function was predefined in the question. It had to be
triSup :: Num a => Mat a -> Bool
So I made this chunk of code, right here:
type Mat a = [[a]]
triSup :: Num a => Mat a -> Bool
triSup m = all (==0) (zero m)
zero :: Num a => Mat a -> [a]
zero m = concat (zipWith ($) (zipWith ($) (replicate (length m) take) [0..((length m)-1)]) m)
Problem is, ghci says he can't compare my Numeric a's with 0 (which I do not understand why btw). It says I need Eq a, even though I cannot alter the function's type. I need help.