-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-haskell/cond: fix build failure against ghc-7.6
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
- Loading branch information
Sergei Trofimovich
committed
Oct 29, 2012
1 parent
ced4a4e
commit a8e6bea
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |