[Haskell-cafe] mixing map and mapM ?

briand at aracnet.com briand at aracnet.com
Thu May 6 01:01:29 EDT 2010


I was doing the following:


do status <- mapM PF.getFileStatus filenames
   let times = map PF.modificationTime status
   let sorted = sortBy (\(_, t1) (_,t2) -> compare t1 t2) (zip filenames times)

and I thought, surely I can combine the status and times definitions into one line, only I can't.

Hint ?

Thanks,

Brian


More information about the Haskell-Cafe mailing list