Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

src/Digest.hs: fix build failure against-0.10

src/Digest.hs:20:10:
    Duplicate instance declarations:
      instance NFData Digest -- Defined at src/Digest.hs:20:10
      instance NFData B.ByteString
        -- Defined in `Data.ByteString.Internal'

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
commit 8e5109be536a8193cb719fb47c070ff73e44323c 1 parent 56e27d9
@trofi trofi authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Digest.hs
View
5 src/Digest.hs
@@ -1,5 +1,5 @@
-- | Simple abstraction for message digests
-{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE TypeSynonymInstances, CPP #-}
module Digest
( Digest
, digest
@@ -17,7 +17,10 @@ import qualified Crypto.Hash.SHA1 as SHA1
-- Consider newtyping this
type Digest = B.ByteString
+#if ! MIN_VERSION_bytestring(0,10,0)
+-- instance was introduced
instance NFData Digest
+#endif
digest :: L.ByteString -> B.ByteString
digest bs = {-# SCC "sha1_digest" #-} SHA1.hashlazy bs
Please sign in to comment.
Something went wrong with that request. Please try again.