From 96549f4c87d3b4662f8caa20035ab4fb30f65ef3 Mon Sep 17 00:00:00 2001 From: David Waern Date: Fri, 11 Sep 2009 11:22:29 +0000 Subject: Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. --- src/Haddock/InterfaceFile.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index d2416afe..fbe3a712 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -308,8 +308,8 @@ serialiseName bh name _ = do -- Hmm, why didn't we dare to make this instance already? It makes things -- much easier. instance (Ord k, Binary k, Binary v) => Binary (Map k v) where - put_ bh m = put_ bh (Map.toAscList m) - get bh = fmap (Map.fromAscList) (get bh) + put_ bh m = put_ bh (Map.toList m) + get bh = fmap (Map.fromList) (get bh) instance Binary InterfaceFile where -- cgit v1.2.3