From 177d37b54a1098e7778d496fafdfe0c6d83c894d Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 27 Jul 2010 15:17:46 +0000 Subject: [PATCH] Avoid need for ambiguity resolution; be explicit --- System/Directory.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/System/Directory.hs b/System/Directory.hs index 688a10b..269f4fd 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -936,10 +936,15 @@ getModificationTime name = do modificationTime st #else stat <- Posix.getFileStatus name - let realToInteger = round . realToFrac :: Real a => a -> Integer - return (TOD (realToInteger (Posix.modificationTime stat)) 0) + let mod_time :: Posix.EpochTime + mod_time = Posix.modificationTime stat + dbl_time :: Double + dbl_time = realToFrac mod_time + return (TOD (round dbl_time) 0) #endif - + -- For info + -- round :: (RealFrac a, Integral b => a -> b + -- realToFrac :: (Real a, Fractional b) => a -> b #endif /* __GLASGOW_HASKELL__ */ @@ -963,8 +968,9 @@ withFileOrSymlinkStatus loc name f = do modificationTime :: Ptr CStat -> IO ClockTime modificationTime stat = do mtime <- st_mtime stat - let realToInteger = round . realToFrac :: Real a => a -> Integer - return (TOD (realToInteger (mtime :: CTime)) 0) + let dbl_time :: Double + dbl_time = realToFrac (mtime :: CTime) + return (TOD (round dbl_time) 0) isDirectory :: Ptr CStat -> IO Bool isDirectory stat = do -- 1.7.10.4