On 6 May 2010 15:20, <bri...@aracnet.com> wrote: > well now it's obvious :-) I did have liftM in there, but just couldn't > quite figure out how to tie things together. > > to be completely clear : liftM takes modificationTime from > > Status -> EpochTime > > to > > IO Status -> IO EpochTime
You can see it that way, yes (of course, liftM works on all monads, not just IO). > so now it can operate on the results of getFileStatus, which > returns `IO Status`. Operate directly on the returned values; you could always use something like "(return . modificationTime) =<< getFileStatus file" as well. > mapM gathers the [IO EpochTime] into `IO [EpochTime]` and then <- gives > [EpochTime]. No, it's the sequence function that does that (but mapM f = sequence . map f). -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe