[Haskell-cafe] Re: how to apply a function which returns IO() to a list?

Max Vasin max-appolo at mail.ru
Wed Jun 14 11:32:33 EDT 2006


>>>>> "developer" == developer  <developer at imaginando.net> writes:

developer> Hi, I have this function which write a file:

developer> writeHtml b x y = do writeFile (b ++ ".html") (htmlCode b x
developer> y)

developer> i need to apply to each member of a given list:

developer> the way i always try to codify functions in haskell is
developer> allways the same, the most primitive one and i think i cant
developer> use it here.

developer> writeList [] = ???  
developer> writeList (x:xs) = (writeHtml x) ???

writeList [] = return ()
writeList (x:xs) = do writeHtml x
                      writeList xs

-- 
WBR,
Max Vasin.





More information about the Haskell-Cafe mailing list