Skip to content
Browse files

dev-haskell/cond: fix build failure against ghc-7.6

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
1 parent ced4a4e commit a8e6beab0526df3c92e610c6cd39afcd2f3e1608 @trofi trofi committed Oct 29, 2012
Showing with 30 additions and 1 deletion.
  1. +3 −1 dev-haskell/cond/cond-0.4.0.1.ebuild
  2. +27 −0 dev-haskell/cond/files/cond-0.4.0.1-ghc-7.6.patch
View
4 dev-haskell/cond/cond-0.4.0.1.ebuild
@@ -7,7 +7,7 @@ EAPI=5
# ebuild generated by hackport 0.3.9999
CABAL_FEATURES="lib profile haddock hoogle hscolour"
-inherit haskell-cabal
+inherit base haskell-cabal
DESCRIPTION="Basic conditional and boolean operators with monadic variants."
HOMEPAGE="https://github.com/kallisti-dev/cond"
@@ -21,3 +21,5 @@ IUSE=""
RDEPEND=">=dev-lang/ghc-6.10.4:="
DEPEND="${RDEPEND}
>=dev-haskell/cabal-1.6"
+
+PATCHES=("${FILESDIR}"/${P}-ghc-7.6.patch)
View
27 dev-haskell/cond/files/cond-0.4.0.1-ghc-7.6.patch
@@ -0,0 +1,27 @@
+Fixes the following build failure:
+
+[1 of 2] Compiling Data.Algebra.Boolean ( src/Data/Algebra/Boolean.hs, dist/build/Data/Algebra/Boolean.o )
+
+src/Data/Algebra/Boolean.hs:125:20:
+ Could not deduce (Num a) arising from the literal `0'
+ from the context (Bits a)
+ bound by the instance declaration
+ at src/Data/Algebra/Boolean.hs:123:10-38
+ Possible fix:
+ add (Num a) to the context of the instance declaration
+ In the first argument of `Bitwise', namely `0'
+ In the expression: Bitwise 0
+ In an equation for `false': false = Bitwise 0
+diff --git a/src/Data/Algebra/Boolean.hs b/src/Data/Algebra/Boolean.hs
+index 46481fc..0cae046 100644
+--- a/src/Data/Algebra/Boolean.hs
++++ b/src/Data/Algebra/Boolean.hs
+@@ -120,7 +120,7 @@ newtype Bitwise a = Bitwise {getBits :: a}
+ deriving (Num, Bits, Eq, Ord, Bounded, Enum, Show, Read, Real,
+ Integral, Typeable, Data, Ix, Storable, PrintfArg)
+
+-instance Bits a => Boolean (Bitwise a) where
++instance (Bits a, Num a) => Boolean (Bitwise a) where
+ true = not false
+ false = Bitwise 0
+ not = Bitwise . complement . getBits

0 comments on commit a8e6bea

Please sign in to comment.
Something went wrong with that request. Please try again.