From 8915810f371a31a30328a04f5e010a32f114a985 Mon Sep 17 00:00:00 2001 From: "https://www.joachim-breitner.de/" Date: Sun, 7 May 2017 03:19:14 +0000 Subject: Added a comment --- ...omment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment 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) +``` +"""]] -- cgit v1.2.3 From 09d8a31d108c37bcf92096c03659f4ad97062945 Mon Sep 17 00:00:00 2001 From: "https://www.joachim-breitner.de/" Date: Sun, 7 May 2017 03:19:37 +0000 Subject: removed --- ...omment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment diff --git a/doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment b/doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment deleted file mode 100644 index 1318d16..0000000 --- a/doc/protocol/comment_3_e2d91431651d3ffe9072bd110b2fdc1d._comment +++ /dev/null @@ -1,19 +0,0 @@ -[[!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) -``` -"""]] -- cgit v1.2.3 From 0d178f087b6a0a5c761df7765d15544dcff948a1 Mon Sep 17 00:00:00 2001 From: "https://www.joachim-breitner.de/" Date: Sun, 7 May 2017 03:20:39 +0000 Subject: Added a comment --- ...ent_3_6338e14886f146eb5d2f9c9316e1f7de._comment | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/protocol/comment_3_6338e14886f146eb5d2f9c9316e1f7de._comment diff --git a/doc/protocol/comment_3_6338e14886f146eb5d2f9c9316e1f7de._comment b/doc/protocol/comment_3_6338e14886f146eb5d2f9c9316e1f7de._comment new file mode 100644 index 0000000..657a20a --- /dev/null +++ b/doc/protocol/comment_3_6338e14886f146eb5d2f9c9316e1f7de._comment @@ -0,0 +1,22 @@ +[[!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:20:38Z" + 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) + +"""]] -- cgit v1.2.3