Date: 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"] 
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

Profile

deniok: (Default)
deniok

February 2022

S M T W T F S
  12345
6789101112
13141516171819
20212223 242526
2728     

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 30th, 2025 07:58 pm
Powered by Dreamwidth Studios