m = [[1,0,0],[2,-3,0],[4,5]]
t all@(x:xs) = let (m, n) = (length all, length x) in all (==n) (map length all)
The command:
t m
gives:
Couldn't match expected type `(Int -> Bool) -> [Int] -> t'
against inferred type `[[a]]'
In the expression: all (== n) (map length all)
In the expression:
let (m, n) = (length all, length x) in all (== n) (map length all)
In the definition of `t':
t (all@(x : xs))
= let (m, n) = ... in all (== n) (map length all)
The reason is, that you redefine the symbol
allto the parameter oft. Thus, the localallshadows the globalalland you get this error. As a solution, try to give your localallanother name.