[commit: packages/directory] improve-tests, improve-tests-for-real, master, tmp: Use import list for `Data.Time(.Clock.POSIX)` (5e3524b)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:36:25 UTC 2015


Repository : ssh://git@git.haskell.org/directory

On branches: improve-tests,improve-tests-for-real,master,tmp
Link       : http://ghc.haskell.org/trac/ghc/changeset/5e3524b7567a1c5709efef9f76f561390ba6d723/directory

>---------------------------------------------------------------

commit 5e3524b7567a1c5709efef9f76f561390ba6d723
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Wed Sep 10 23:16:19 2014 +0200

    Use import list for `Data.Time(.Clock.POSIX)`
    
    This makes it more obvious why `directory` depends on `time` in the
    first place, i.e. for the `UTCTime` and `POSIXTime` types, as well as
    for the `posixSecondsToUTCTime` conversion function between those two.


>---------------------------------------------------------------

5e3524b7567a1c5709efef9f76f561390ba6d723
 System/Directory.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/System/Directory.hs b/System/Directory.hs
index 739892c..203f4aa 100644
--- a/System/Directory.hs
+++ b/System/Directory.hs
@@ -95,8 +95,8 @@ import Foreign.C
 
 import Data.Maybe
 
-import Data.Time
-import Data.Time.Clock.POSIX
+import Data.Time ( UTCTime )
+import Data.Time.Clock.POSIX ( POSIXTime, posixSecondsToUTCTime )
 
 #ifdef __GLASGOW_HASKELL__
 
@@ -1041,7 +1041,7 @@ withFileOrSymlinkStatus loc name f = do
 modificationTime :: Ptr CStat -> IO UTCTime
 modificationTime stat = do
     mtime <- st_mtime stat
-    return $ posixSecondsToUTCTime $ realToFrac (mtime :: CTime)
+    return $ posixSecondsToUTCTime (realToFrac (mtime :: CTime) :: POSIXTime)
 
 isDirectory :: Ptr CStat -> IO Bool
 isDirectory stat = do



More information about the ghc-commits mailing list