From 03c33aa0b4b775bace17c10bbfbd85da44a6f9a2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 May 2017 21:36:26 -0400 Subject: fix from nomeata's review He pointed out that Just () and Nothing would hash the same. Luckily Maybe Hash is the only Maybe type that needs to be hashed, so specialize the instance. --- Hash.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Hash.hs') 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 -- cgit v1.2.3