I am still a haskell beginner. Can I do a double map in haskell?
For example, if I have a [[Char]] and I want to convert each Char in each [Char] to lower case, is there an easy way to do this rather than something like:
exampleF [] = []
exampleF (x:xs) = (map toLower x) : exampleF xs
You can think of
map f, as transforming a functionf :: a -> binto a function on listsmap f :: [a] -> [b], so if you want to transform it further into a function on lists of lists, you just need to usemapagain to getmap (map f) :: [[a]] -> [[b]].In this particular case, that becomes: