Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 9621548

Browse files
committed
provide ord instance for map
1 parent a9e88d6 commit 9621548

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Data/Map.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ instance eqMap :: (Eq k, Eq v) => Eq (Map k v) where
4646
instance showMap :: (Show k, Show v) => Show (Map k v) where
4747
show m = "fromList " ++ show (toList m)
4848

49+
instance ordMap :: (Ord k, Ord v) => Ord (Map k v) where
50+
compare m1 m2 = compare (toList m1) (toList m2)
51+
4952
instance semigroupMap :: (Ord k) => Semigroup (Map k v) where
5053
(<>) = union
5154

0 commit comments

Comments
 (0)