Commit 746ab0b4 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add an Outputable instance for ListMap

parent 6bb32ba7
......@@ -278,6 +278,9 @@ instance TrieMap m => TrieMap (ListMap m) where
foldTM = fdList
mapTM = mapList
instance (TrieMap m, Outputable a) => Outputable (ListMap m a) where
ppr m = text "List elts" <+> ppr (foldTM (:) m [])
mapList :: TrieMap m => (a->b) -> ListMap m a -> ListMap m b
mapList f (LM { lm_nil = mnil, lm_cons = mcons })
= LM { lm_nil = fmap f mnil, lm_cons = mapTM (mapTM f) mcons }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment