summaryrefslogtreecommitdiffhomepage
path: root/Hash.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-14 19:39:23 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-14 19:39:23 -0400
commit74003096f8018827dde28b5746a19c1e325bc68f (patch)
treede5343b6dae38d4ae06b8ad004f45b9669b28cb6 /Hash.hs
parent0222ca35ec03836ab216aff1a38e337e2be16511 (diff)
downloaddebug-me-74003096f8018827dde28b5746a19c1e325bc68f.tar.gz
add --graphviz mode
This commit was sponsored by Shane-o on Patreon.
Diffstat (limited to 'Hash.hs')
-rw-r--r--Hash.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Hash.hs b/Hash.hs
index f2b8d75..53be540 100644
--- a/Hash.hs
+++ b/Hash.hs
@@ -9,11 +9,11 @@ import qualified Data.ByteString.Char8 as C8
import qualified Crypto.Hash as H
class Hashable a where
- hash :: a -> HashPointer
+ hash :: a -> Hash
instance Hashable B.ByteString where
-- Encodes the SHA256 using base16 format
- hash = HashPointer SHA256 . Val . C8.pack . show . sha256
+ hash = Hash SHA256 . Val . C8.pack . show . sha256
instance Hashable Val where
hash (Val v) = hash v
@@ -22,7 +22,7 @@ sha256 :: B.ByteString -> H.Digest H.SHA256
sha256 = H.hash
-- | Hash the concacenation of the hashes.
-instance Hashable [HashPointer] where
+instance Hashable [Hash] where
hash = hash . B.concat . map (val . hashValue)
instance Hashable a => Hashable (Activity a) where