[commit: packages/time] format-widths, ghc, improve-leapseconds, master, posix-perf, tasty, wip/travis: version 1.3: instance RealFrac DiffTime (234e6ce)

git at git.haskell.org git at git.haskell.org
Fri Apr 21 16:51:10 UTC 2017


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

On branches: format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis
Link       : http://git.haskell.org/packages/time.git/commitdiff/234e6cef3c5ade6b46b7a55a90c12247d918bf0a

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

commit 234e6cef3c5ade6b46b7a55a90c12247d918bf0a
Author: Ashley Yakeley <ashley at semantic.org>
Date:   Tue Aug 9 19:12:09 2011 -0700

    version 1.3: instance RealFrac DiffTime
    
    Ignore-this: db3b670e3c17170909ab4c5b34b83716
    
    darcs-hash:20110810021209-ac6dd-915d3dcb3b6e543f834c997820182d669e7bb2ac


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

234e6cef3c5ade6b46b7a55a90c12247d918bf0a
 Data/Time/Clock/Scale.hs | 8 ++++++++
 configure.ac             | 2 +-
 time.cabal               | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Data/Time/Clock/Scale.hs b/Data/Time/Clock/Scale.hs
index f07fd64..fb67cc5 100644
--- a/Data/Time/Clock/Scale.hs
+++ b/Data/Time/Clock/Scale.hs
@@ -83,6 +83,14 @@ instance Fractional DiffTime where
 	recip (MkDiffTime a) = MkDiffTime (recip a)
 	fromRational r = MkDiffTime (fromRational r)
 
+-- necessary because H98 doesn't have "cunning newtype" derivation
+instance RealFrac DiffTime where
+    properFraction (MkDiffTime a) = let (b',a') = properFraction a in (b',MkDiffTime a')
+    truncate (MkDiffTime a) = truncate a
+    round (MkDiffTime a) = round a
+    ceiling (MkDiffTime a) = ceiling a
+    floor (MkDiffTime a) = floor a
+
 -- | Create a 'DiffTime' which represents an integral number of seconds.
 secondsToDiffTime :: Integer -> DiffTime
 secondsToDiffTime = fromInteger
diff --git a/configure.ac b/configure.ac
index b04e8cd..dc58c49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([Haskell time package], [1.2.0.3], [ashley at semantic.org], [time])
+AC_INIT([Haskell time package], [1.3], [ashley at semantic.org], [time])
 
 # Safety check: Ensure that we are in the correct source directory.
 AC_CONFIG_SRCDIR([include/HsTime.h])
diff --git a/time.cabal b/time.cabal
index 5ca5557..21bf3e4 100644
--- a/time.cabal
+++ b/time.cabal
@@ -1,5 +1,5 @@
 name:           time
-version:        1.2.0.5
+version:        1.3
 stability:      stable
 license:        BSD3
 license-file:   LICENSE



More information about the ghc-commits mailing list