Look at the map type. This is (a -> b) -> [a] -> [b] . This is not like your type, which is [a] β b. This is not a map, this is a fold.
The higher order function you want to see is foldr . See Hoogle .
Something like...
htmlHAtendimento :: [HoraAtendimento] -> Html htmlHAtendimento [] = toHtml "" htmlHAtendimento l = foldr1 (+++) $ intersperse ", " $ map fl where f (da, hia, hfa) = toHtml da +++ "feira " +++ show hia +++ "h - " +++ show hfa +++ "h"
I do not know if this is right, but it is in the right direction.
Apocalisp
source share