summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorhttps://www.joachim-breitner.de/ <nomeata@web>2017-05-07 03:19:14 +0000
committeradmin <admin@branchable.com>2017-05-07 03:19:14 +0000
commit8915810f371a31a30328a04f5e010a32f114a985 (patch)
tree664ce3225aa5481149ad2724a09a339d54930f9c
parent03c33aa0b4b775bace17c10bbfbd85da44a6f9a2 (diff)
downloaddebug-me-8915810f371a31a30328a04f5e010a32f114a985.tar.gz
Added a comment
-rw-r--r--doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment b/doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment
new file mode 100644
index 0000000..1318d16
--- /dev/null
+++ b/doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment
@@ -0,0 +1,19 @@
+[[!comment format=mdwn
+ username="https://www.joachim-breitner.de/"
+ nickname="nomeata"
+ avatar="http://cdn.libravatar.org/avatar/a2112893817513537c6a2c228c04c138a2f68bba57121ab7f267de58fc5171d7"
+ subject="comment 3"
+ date="2017-05-07T03:19:14Z"
+ content="""
+Still not good, I think, as the instance `Hashable Hash` has `hash = id`, so
+```
+hash Nothing = hash () = id (hash ()) = hash (Just (hash ())
+```
+and we have a collision at type `Maybe Hash`.
+
+What would work is to do the same that `Hashable []` does, i.e. has the hash again:
+```
+ hash (Just v) = hash (val (hashValue v))
+ hash Nothing = hash (mempty :: B.ByteString)
+```
+"""]]