Skip to content

Commit

Permalink
dev-haskell/cond: fix build failure against ghc-7.6
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information
Sergei Trofimovich committed Oct 29, 2012
1 parent ced4a4e commit a8e6bea
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dev-haskell/cond/cond-0.4.0.1.ebuild
Expand Up @@ -7,7 +7,7 @@ EAPI=5
# ebuild generated by hackport 0.3.9999 # ebuild generated by hackport 0.3.9999


CABAL_FEATURES="lib profile haddock hoogle hscolour" CABAL_FEATURES="lib profile haddock hoogle hscolour"
inherit haskell-cabal inherit base haskell-cabal


DESCRIPTION="Basic conditional and boolean operators with monadic variants." DESCRIPTION="Basic conditional and boolean operators with monadic variants."
HOMEPAGE="https://github.com/kallisti-dev/cond" HOMEPAGE="https://github.com/kallisti-dev/cond"
Expand All @@ -21,3 +21,5 @@ IUSE=""
RDEPEND=">=dev-lang/ghc-6.10.4:=" RDEPEND=">=dev-lang/ghc-6.10.4:="
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
>=dev-haskell/cabal-1.6" >=dev-haskell/cabal-1.6"

PATCHES=("${FILESDIR}"/${P}-ghc-7.6.patch)
27 changes: 27 additions & 0 deletions 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.