summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hallgren <th-github@altocumulus.org>2019-05-15 12:05:38 +0200
committerThomas Hallgren <th-github@altocumulus.org>2019-05-15 12:05:38 +0200
commit86066d4b12d61e999740bf6a3a09b6547697ee13 (patch)
tree9f1571087789c47ae18c4da05a0d7eb380bf22be /src
parentaf62a99bf535dc45d44d8546faab938485e49c84 (diff)
Eliminate the dependency on time-compat
It was only needed for compatibility with directory<1.2, but directory>=1.2 has been shipped with ghc since ghc-7.6. Note: time-compat-1.9.* (the current version) is a completely different package, that does not provide the needed function toUTCTime, which was provided in time-compat-0.1.*.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/System/Directory.hs4
-rw-r--r--src/server/Cache.hs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/System/Directory.hs b/src/compiler/GF/System/Directory.hs
index 898646063..be91e758e 100644
--- a/src/compiler/GF/System/Directory.hs
+++ b/src/compiler/GF/System/Directory.hs
@@ -8,13 +8,13 @@ import System.Directory as D
doesDirectoryExist,doesFileExist,getModificationTime,
getCurrentDirectory,getDirectoryContents,getPermissions,
removeFile,renameFile)
-import Data.Time.Compat
+--import Data.Time.Compat
canonicalizePath path = liftIO $ D.canonicalizePath path
createDirectoryIfMissing b = liftIO . D.createDirectoryIfMissing b
doesDirectoryExist path = liftIO $ D.doesDirectoryExist path
doesFileExist path = liftIO $ D.doesFileExist path
-getModificationTime path = liftIO $ fmap toUTCTime (D.getModificationTime path)
+getModificationTime path = liftIO $ {-fmap toUTCTime-} (D.getModificationTime path)
getDirectoryContents path = liftIO $ D.getDirectoryContents path
getCurrentDirectory :: MonadIO io => io FilePath
diff --git a/src/server/Cache.hs b/src/server/Cache.hs
index d05ee2557..dc1eebdba 100644
--- a/src/server/Cache.hs
+++ b/src/server/Cache.hs
@@ -9,7 +9,7 @@ import Data.Maybe(mapMaybe)
import System.Directory (getModificationTime)
import System.Mem(performGC)
import Data.Time (UTCTime,getCurrentTime,diffUTCTime)
-import Data.Time.Compat (toUTCTime)
+--import Data.Time.Compat (toUTCTime)
data Cache a = Cache {
cacheLoad :: FilePath -> IO a,
@@ -63,7 +63,7 @@ readCache' c file =
Nothing -> do v <- newMVar Nothing
return (Map.insert file v objs, v)
-- Check time stamp, and reload if different than the cache entry
- readObject m = do t' <- toUTCTime `fmap` getModificationTime file
+ readObject m = do t' <- {-toUTCTime `fmap`-} getModificationTime file
now <- getCurrentTime
x' <- case m of
Just (t,_,x) | t' == t -> return x