aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/ghc-aeson-encodeDouble.patch25
-rw-r--r--gnu/packages/patches/ghc-clock-realfrag.patch22
2 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/patches/ghc-aeson-encodeDouble.patch b/gnu/packages/patches/ghc-aeson-encodeDouble.patch
new file mode 100644
index 0000000000..11ad425eae
--- /dev/null
+++ b/gnu/packages/patches/ghc-aeson-encodeDouble.patch
@@ -0,0 +1,25 @@
+From 58766a1916b4980792763bab74f0c86e2a7ebf20 Mon Sep 17 00:00:00 2001
+From: Oleg Grenrus <oleg.grenrus@iki.fi>
+Date: Thu, 1 Jun 2023 22:58:28 +0300
+Subject: [PATCH] QC-2.14.3 Double generators generates infinite number too
+
+---
+ tests/PropUtils.hs | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tests/PropUtils.hs b/tests/PropUtils.hs
+index 3c449029a..43de85d7f 100644
+--- a/tests/PropUtils.hs
++++ b/tests/PropUtils.hs
+@@ -51,8 +51,9 @@ import qualified Data.Aeson.Decoding as Dec
+
+ encodeDouble :: Double -> Double -> Property
+ encodeDouble num denom
+- | isInfinite d || isNaN d = encode d === "null"
+- | otherwise = (read . L.unpack . encode) d === d
++ | isNaN d = encode d === "null"
++ | isInfinite d = if d > 0 then encode d === "\"+inf\"" else encode d === "\"-inf\""
++ | otherwise = (read . L.unpack . encode) d === d
+ where d = num / denom
+
+ encodeInteger :: Integer -> Property
diff --git a/gnu/packages/patches/ghc-clock-realfrag.patch b/gnu/packages/patches/ghc-clock-realfrag.patch
new file mode 100644
index 0000000000..0f7bb0542a
--- /dev/null
+++ b/gnu/packages/patches/ghc-clock-realfrag.patch
@@ -0,0 +1,22 @@
+From 8372e801ef062223756db69818a7b60cfd9bb066 Mon Sep 17 00:00:00 2001
+From: amesgen <amesgen@amesgen.de>
+Date: Tue, 8 Aug 2023 23:36:45 +0200
+Subject: [PATCH] Fix `RealFrac Seconds` instance
+
+---
+ System/Clock/Seconds.hs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/System/Clock/Seconds.hs b/System/Clock/Seconds.hs
+index a9a1c78..f7457cb 100644
+--- a/System/Clock/Seconds.hs
++++ b/System/Clock/Seconds.hs
+@@ -50,7 +50,7 @@ instance Fractional Seconds where
+
+ instance RealFrac Seconds where
+ properFraction (Seconds (TimeSpec s ns))
+- | s >= 0 = (fromIntegral s, Seconds $ TimeSpec 0 ns)
++ | s >= 0 || ns == 0 = (fromIntegral s, Seconds $ TimeSpec 0 ns)
+ | otherwise = (fromIntegral (s+1), Seconds $ TimeSpec (-1) ns)
+
+ -- | The 'getTime' function shall return the current value for the