Commit 483417ad authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

polynomial: Patch to build with ghc-8.4

parent f135ec1f
haskell-polynomial (0.7.3-5) unstable; urgency=medium
* Patch to build with ghc-8.4
-- Ilias Tsitsimpis <iliastsi@debian.org> Thu, 04 Oct 2018 19:28:12 +0300
haskell-polynomial (0.7.3-4) unstable; urgency=medium
[ Clint Adams ]
......
From 6c624362bd41da88db589897f4d72ac9de14e329 Mon Sep 17 00:00:00 2001
From: Fumiaki Kinoshita <fumiexcel@gmail.com>
Date: Tue, 27 Feb 2018 10:16:34 +0900
Subject: [PATCH] Fix the compile error on base-4.11
---
src/Math/Polynomial/Pretty.hs | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/Math/Polynomial/Pretty.hs b/src/Math/Polynomial/Pretty.hs
index f250228..778ccde 100644
--- a/src/Math/Polynomial/Pretty.hs
+++ b/src/Math/Polynomial/Pretty.hs
@@ -1,6 +1,7 @@
-{-# LANGUAGE
+{-# LANGUAGE
ParallelListComp, ViewPatterns,
- FlexibleInstances, FlexibleContexts, IncoherentInstances
+ FlexibleInstances, FlexibleContexts, IncoherentInstances,
+ CPP
#-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
@@ -11,6 +12,9 @@
-- |This module exports a 'Pretty' instance for the 'Poly' type.
module Math.Polynomial.Pretty () where
+#if MIN_VERSION_base(4,11,0)
+import Prelude hiding ((<>))
+#endif
import Math.Polynomial.Type
import Data.Complex
@@ -39,14 +43,14 @@ instance (RealFloat a, Pretty (Complex a)) => Pretty (Poly (Complex a)) where
pPrintPolyWith prec end v p = parenSep (prec > 5) $ filter (not . isEmpty)
[ v first coeff exp
- | (coeff, exp) <-
+ | (coeff, exp) <-
(if end == BE then reverse else dropWhile ((0==).fst))
(zip (polyCoeffs LE p) [0..])
| first <- True : repeat False
]
-parenSep p xs =
- prettyParen (p && not (null (drop 1 xs)))
+parenSep p xs =
+ prettyParen (p && not (null (drop 1 xs)))
(hsep xs)
pPrintOrdTerm _ _ _ 0 _ = empty
@@ -69,4 +73,3 @@ pPrintUnOrdTerm _ v f 1 1 = sign f 1 <> char v
pPrintUnOrdTerm num v f c 1 = sign f 1 <> num c <> char v
pPrintUnOrdTerm _ v f 1 e = sign f 1 <> char v <> text "^" <> int e
pPrintUnOrdTerm num v f c e = sign f 1 <> num c <> char v <> text "^" <> int e
-
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment