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

Commit 7a6cd51

Browse files
committed
Switched Eq, Ord, and Show instances to use toAscList
1 parent 8185cf7 commit 7a6cd51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Data/Map.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ data Map k v
5454
| Three (Map k v) k v (Map k v) k v (Map k v)
5555

5656
instance eqMap :: (Eq k, Eq v) => Eq (Map k v) where
57-
eq m1 m2 = toList m1 == toList m2
57+
eq m1 m2 = toAscList m1 == toAscList m2
5858

5959
instance ordMap :: (Ord k, Ord v) => Ord (Map k v) where
60-
compare m1 m2 = compare (toList m1) (toList m2)
60+
compare m1 m2 = compare (toAscList m1) (toAscList m2)
6161

6262
instance showMap :: (Show k, Show v) => Show (Map k v) where
63-
show m = "(fromList " <> show (toList m) <> ")"
63+
show m = "(fromList " <> show (toAscList m) <> ")"
6464

6565
instance semigroupMap :: Ord k => Semigroup (Map k v) where
6666
append = union

0 commit comments

Comments
 (0)