[Haskell-cafe] Length of lists within list of lists?

aditya siram aditya.siram at gmail.com
Sat Apr 10 13:07:10 EDT 2010


You need a method that will find the length of a list:
length :: [a] -> Int
and a method that will applies a function to every element of a list
and make a list of the results:
map :: (a ->b) -> [a] -> [b]

Try and put them together.

hth,
-deech



On 4/10/10, boblettoj <boblettoj99 at msn.com> wrote:
>
> Hi i want to know if there is any method i can use to count the number of
> items in each list in a list of lists, eg.
>
> someMethod [[a, b, c], [a], [b, d, e, f]]
> would return [3, 1, 4]
>
> is there anything that can do this?
> thanks
>
> --
> View this message in context:
> http://old.nabble.com/Length-of-lists-within-list-of-lists--tp28203363p28203363.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list