From 234e6cef3c5ade6b46b7a55a90c12247d918bf0a Mon Sep 17 00:00:00 2001 From: Ashley Yakeley <ashley@semantic.org> Date: Tue, 9 Aug 2011 19:12:09 -0700 Subject: [PATCH] version 1.3: instance RealFrac DiffTime Ignore-this: db3b670e3c17170909ab4c5b34b83716 darcs-hash:20110810021209-ac6dd-915d3dcb3b6e543f834c997820182d669e7bb2ac --- 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@semantic.org], [time]) +AC_INIT([Haskell time package], [1.3], [ashley@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 -- GitLab