getMostRecentFile :: [FilePath] -> IO (Maybe FilePath)
getMostRecentFile xs = do
    xs' <- filterM doesFileExist xs >>=
             mapM (\f -> liftM (\m -> (f,m)) $ getModificationTime f) >>= \x ->
               return $ sortBy (flip compare `on` snd) x
    return $ listToMaybe (map fst xs')
getMostRecentFile :: [FilePath] -> IO (Maybe FilePath)
getMostRecentFile xs = do
    xs' <- filterM doesFileExist xs >>=
             mapM (\f -> liftM (\m -> (f,m)) $ getModificationTime f) >>= \x ->
               return $ sortBy (flip compare `on` snd) x
    return $ listToMaybe (map fst xs')
getMostRecentFile xs = do
    xs' <- filterM doesFileExist xs >>=
             mapM (\f -> liftM (\m -> (f,m)) $ getModificationTime f) >>= \x ->
               return $ sortBy (flip compare `on` snd) x
    return $ listToMaybe (map fst xs')