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)
Команда:
t m
дает:
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)