on master help sign in
Merge pull request #4606 from dmalikov/Show_SortedMap

Add Show instance for SortedMap

commitb2c46a1e8936cfa1f76c43e9a33e5371bbe32fc5 authorNiklas Larsson <metaniklas@gmail.com> dateMon 10 Dec 2018, 15:21 (8 years ago) parentce61f6026502ed
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