[Haskell-cafe] Newb question about map and a list of lists

Jonathan Cast jcast at ou.edu
Fri Sep 28 14:27:23 EDT 2007


On Fri, 2007-09-28 at 11:19 -0700, Chuk Goodin wrote:
> I have a list of lists of pairs of numeric Strings (like this:
> [["2","3"],["1","2"],["13","14"]] etc.) I'd like to change it into a
> list of a list of numbers, but I'm not sure how to go about it. If it
> was just one list, I could use map, but map.map doesn't seem to work.
> Any suggestions, or pointers to a reference online?

map :: (a -> b) -> [a] -> [b], so
map . map :: (a -> b) -> [[a]] -> [[b]]

which is right.  Just be sure to put it in parentheses before you apply
it to anything.  If you need more help, more information on what you did
and what happened would be appreciated.

jcc




More information about the Haskell-Cafe mailing list