on master help sign in
Add Show instance for SortedMap
commit26502edc0828cf40f14d8881f44958f9c0646592 authorDmitry Malikov <malikov.d.y@gmail.com> dateSat 8 Dec 2018, 23:51 (8 years ago) parentce61f60
1 file changed+4
libs/contrib/Data/SortedMap.idr+4
libs/contrib/Data/SortedMap.idr+4
@@ -287,6 +287,10 @@ export
287287mergeLeft : SortedMap k v -> SortedMap k v -> SortedMap k v
288288mergeLeft = mergeWith const
289289
290+export
291+(Show k, Show v) => Show (SortedMap k v) where
292+ show m = "fromList " ++ (show $ toList m)
293+
290294-- TODO: is this the right variant of merge to use for this? I think it is, but
291295-- I could also see the advantages of using `mergeLeft`. The current approach is
292296-- strictly more powerful I believe, because `mergeLeft` can be emulated with