Skip to content

Commit

Permalink
Merge pull request #4606 from dmalikov/Show_SortedMap
Browse files Browse the repository at this point in the history
Add Show instance for SortedMap
  • Loading branch information
melted committed Dec 10, 2018
2 parents ce61f60 + 26502ed commit b2c46a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/contrib/Data/SortedMap.idr
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ export
mergeLeft : SortedMap k v -> SortedMap k v -> SortedMap k v
mergeLeft = mergeWith const

export
(Show k, Show v) => Show (SortedMap k v) where
show m = "fromList " ++ (show $ toList m)

-- TODO: is this the right variant of merge to use for this? I think it is, but
-- I could also see the advantages of using `mergeLeft`. The current approach is
-- strictly more powerful I believe, because `mergeLeft` can be emulated with
Expand Down

0 comments on commit b2c46a1

Please sign in to comment.