[commit: packages/binary] master: Add Show instance for Fingerprint on GHC < 7.8. (8debedd)
git at git.haskell.org
git at git.haskell.org
Wed Dec 16 09:42:25 UTC 2015
Repository : ssh://git@git.haskell.org/binary
On branch : master
Link : http://git.haskell.org/packages/binary.git/commitdiff/8debedd3fcb6525ac0d7de2dd49217dce2abc0d9
>---------------------------------------------------------------
commit 8debedd3fcb6525ac0d7de2dd49217dce2abc0d9
Author: Lennart Kolmodin <kolmodin at google.com>
Date: Wed Jun 3 14:46:21 2015 -0700
Add Show instance for Fingerprint on GHC < 7.8.
'forAll' needs Fingerprint to have a Show instance.
Starting from GHC 7.8 (base-4.7) Fingerprint has a Show instance, but
for older versions we need to provide one ourselves.
>---------------------------------------------------------------
8debedd3fcb6525ac0d7de2dd49217dce2abc0d9
tests/QC.hs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/QC.hs b/tests/QC.hs
index 58991a4..493d2aa 100644
--- a/tests/QC.hs
+++ b/tests/QC.hs
@@ -390,6 +390,10 @@ prop_test_GHC_Fingerprint = forAll gen test
where
gen :: Gen Fingerprint
gen = liftM2 Fingerprint arbitrary arbitrary
+#if !MIN_VERSION_base(4,7,0)
+instance Show Fingerprint where
+ show (Fingerprint x1 x2) = show (x1,x2)
+#endif
#endif
------------------------------------------------------------------------
More information about the ghc-commits
mailing list