[commit: packages/time] master: Changes for Safe Haskell (7cc0d01)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 07:54:30 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/7cc0d011e7a956c62d1c6a5d83b302cb938693e4

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

commit 7cc0d011e7a956c62d1c6a5d83b302cb938693e4
Author: omari <omari at smileystation.com>
Date:   Thu Feb 13 15:24:36 2014 -0800

    Changes for Safe Haskell
    
    Ignore-this: c7c8f97541bd4ab2620613c51fad3b91
    
    Makes minimal necessary changes so that modules will infer as Safe
    for Safe Haskell.  Some modules are using rewrite rules, which are
    not Safe; to these I added Trustworthy pragmas.  The rewrite rules
    will continue to fire as normal, according to GHC's documentation.
    
    Other modules import Foreign.  I changed these to import
    Foreign.Safe instead.
    
    I changed the time.cabal file so that the minimum version of Base is
    4.4; that was the first version of Base that has the Foreign.Safe
    module.  (base 4.4 came with GHC 7.2, which is over two years old.)
    
    darcs-hash:20140213232436-6ee4c-27c941c537e6ab258befe3e38b9d9266334e9421


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

7cc0d011e7a956c62d1c6a5d83b302cb938693e4
 Data/Time/Clock/CTimeval.hs     | 2 +-
 Data/Time/Clock/Scale.hs        | 1 +
 Data/Time/Clock/UTC.hs          | 1 +
 Data/Time/LocalTime/TimeZone.hs | 2 +-
 time.cabal                      | 2 +-
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Data/Time/Clock/CTimeval.hs b/Data/Time/Clock/CTimeval.hs
index b0d8920..c8a692a 100644
--- a/Data/Time/Clock/CTimeval.hs
+++ b/Data/Time/Clock/CTimeval.hs
@@ -4,7 +4,7 @@ module Data.Time.Clock.CTimeval where
 #ifndef mingw32_HOST_OS
 -- All Unix-specific, this
 
-import Foreign
+import Foreign.Safe
 import Foreign.C
 
 data CTimeval = MkCTimeval CLong CLong
diff --git a/Data/Time/Clock/Scale.hs b/Data/Time/Clock/Scale.hs
index 9e91795..8ba7759 100644
--- a/Data/Time/Clock/Scale.hs
+++ b/Data/Time/Clock/Scale.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE Trustworthy #-}
 {-# OPTIONS -fno-warn-unused-imports #-}
 #include "HsConfigure.h"
 -- #hide
diff --git a/Data/Time/Clock/UTC.hs b/Data/Time/Clock/UTC.hs
index 3ba3309..d41b8f8 100644
--- a/Data/Time/Clock/UTC.hs
+++ b/Data/Time/Clock/UTC.hs
@@ -1,4 +1,5 @@
 {-# OPTIONS -fno-warn-unused-imports #-}
+{-# LANGUAGE Trustworthy #-}
 #include "HsConfigure.h"
 -- #hide
 module Data.Time.Clock.UTC
diff --git a/Data/Time/LocalTime/TimeZone.hs b/Data/Time/LocalTime/TimeZone.hs
index fa70026..e9e4f5f 100644
--- a/Data/Time/LocalTime/TimeZone.hs
+++ b/Data/Time/LocalTime/TimeZone.hs
@@ -17,7 +17,7 @@ import Data.Time.Calendar.Private
 import Data.Time.Clock
 import Data.Time.Clock.POSIX
 
-import Foreign
+import Foreign.Safe
 import Foreign.C
 import Control.DeepSeq
 import Data.Typeable
diff --git a/time.cabal b/time.cabal
index e1f7d79..334fa08 100644
--- a/time.cabal
+++ b/time.cabal
@@ -36,7 +36,7 @@ source-repository head
 
 library
     build-depends: 
-        base >= 4 && < 5,
+        base >= 4.4 && < 5,
         deepseq >= 1.1,
         old-locale
     ghc-options: -Wall



More information about the ghc-commits mailing list