summary refs log tree commit diff
path: root/pkgs/development/libraries/haskell/Crypto/class-constraints.diff
blob: 77035322678ad0e3656b04d449998999b0f41910 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/Data/Digest/SHA2.hs
+++ b/Data/Digest/SHA2.hs
@@ -106,7 +106,7 @@
 data Hash384 = Hash384 !Word64 !Word64 !Word64 !Word64 !Word64 !Word64 deriving (Eq, Ord)
 data Hash224 = Hash224 !Word32 !Word32 !Word32 !Word32 !Word32 !Word32 !Word32 deriving (Eq, Ord)
 
-instance (Integral a) => Show (Hash8 a) where
+instance (Integral a, Show a) => Show (Hash8 a) where
  showsPrec _ (Hash8 a b c d e f g h) =
   (showHex a) . (' ':) .
   (showHex b) . (' ':) .
@@ -146,7 +146,7 @@
      where
       bs = bitSize (head r)
 
-instance (Integral h, Bits h) => Hash (Hash8 h) where
+instance (Integral h, Bits h, Show h) => Hash (Hash8 h) where
   toOctets (Hash8 x0 x1 x2 x3 x4 x5 x6 x7) = bitsToOctets =<< [x0, x1, x2, x3, x4, x5, x6, x7]
 
 instance Hash Hash384 where
@@ -282,4 +282,4 @@
 
 -- Test with:
 -- ghc -no-recomp -O --make Data/Digest/SHA2.hs -main-is Data.Digest.SHA2.moduleTest -o moduleTest && ./moduleTest && rm moduleTest
-moduleTest = runTestTT test_sha2
\ No newline at end of file
+moduleTest = runTestTT test_sha2