summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Hash.hs2
-rw-r--r--doc/protocol/comment_2_4a25b8ee6e438a031e875078ffb1d125._comment10
2 files changed, 11 insertions, 1 deletions
diff --git a/Hash.hs b/Hash.hs
index 8a33803..a76e0b4 100644
--- a/Hash.hs
+++ b/Hash.hs
@@ -84,7 +84,7 @@ instance Hashable [Hash] where
hash = hash . B.concat . map (val . hashValue)
-- | Hash empty string for Nothing
-instance Hashable v => Hashable (Maybe v) where
+instance Hashable (Maybe Hash) where
hash Nothing = hash ()
hash (Just v) = hash v
diff --git a/doc/protocol/comment_2_4a25b8ee6e438a031e875078ffb1d125._comment b/doc/protocol/comment_2_4a25b8ee6e438a031e875078ffb1d125._comment
new file mode 100644
index 0000000..935570d
--- /dev/null
+++ b/doc/protocol/comment_2_4a25b8ee6e438a031e875078ffb1d125._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2017-05-06T01:34:39Z"
+ content="""
+Thanks for that review. That would indeed be bad. To avoid that
+potential problem, I've specialized the instance to
+`Hashable (Maybe Hash)`, which is the only Maybe value that currently
+needs to be hashed.
+"""]]