http://vanja-y.livejournal.com/ ([identity profile] vanja-y.livejournal.com) wrote in [personal profile] deniok 2010-02-22 01:12 pm (UTC)

Так как с каждым файлом производится только одна операция можно воспользоваться функцией
appendFile :: FilePath -> String -> IO()

Можно еще автоматизировать создание названий для файлов с результатами. Тогда получится что-то вроде

appendCustom :: String -> FilePath -> [Ext] -> IO()
appendCustom s f l = sequence_ [ appendFile (f ++ "." ++ e) 
                                   (genText e s) | e<-l]

где Ext синоним для String и genText предполагается слегка переделаной. Осталось скомбинировать appendCustom с replicateM:

main = appendCustom (replicateM 30 gen_pd) "res" ["txt","tex","answ.txt","dat.cs"] 

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting