Almost - "liftM modificationTime" has type Status -> IO
EpochTime. Like other IO functions (getLine, putStrLn), it returns an
IO action but accepts a pure value (the modification time)
Also, I like this style:
import Control.Applicative ((<$>))
blah
= do
times
<- mapM (PF.modificationTime <$> PF.getFileStatus) filenames
...
The
<$> operator evaluates to fmap so it's a cleaner way to apply a
pure function to an IO value.
That won't type-check (unless I've missed some crafty trick with the
types?!); you have two functions you want to compose, but the <$>
operator (i.e. fmap) applies a function on the left to a functor-value
on the right. You would instead need: