检查多个列表的长度

Checking the length of multiple lists

length' :: [[Int]] -> [Int]
length' [(x:xs)] = map length'[(x:xs)]

我目前的代码打印出一个输入列表的长度。我如何寻找多个列表的长度。

E.g. Input:  [[2,3,4], [2]] Output: [3,1] 

您可以使用 map 在每个输入的列表上调用 length

length' :: [[a]] -> [Int]
length' = map length