[commit: packages/time] ghc-head: Changes for Safe Haskell (6dffeea)

git at git.haskell.org git at git.haskell.org
Mon Mar 3 08:30:13 UTC 2014


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

On branch  : ghc-head
Link       : http://git.haskell.org/packages/time.git/commitdiff/6dffeeafa97f3c93d902d9191a64ac703ccdb0ac

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

commit 6dffeeafa97f3c93d902d9191a64ac703ccdb0ac
Author: omari <omari at smileystation.com>
Date:   Thu Feb 13 23:24:36 2014 +0000

    Changes for Safe Haskell
    
    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.)


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

6dffeeafa97f3c93d902d9191a64ac703ccdb0ac
 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