
6 May
2010
6 May
'10
8:44 a.m.
Pierre-Etienne Meunier
This way :
do times<-mapM PF.getFileStatus filenames >>= return.(map PF.modificationTime)
Or also :
do times<-mapM (PF.getFileStatus >>= (return.(PF.modificationTime))) filenames let sorted=...
I do not know exactly how ghc compiles the IO monad, but it seems to me that the latter would allocate a little less.
List fusion probably converts them to the same core (you can always use ghc-core to verify this if you care). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com