1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Fix inverted semantics of union.

This commit is contained in:
Rob Rix 2015-12-14 17:06:14 -05:00
parent 1e7dc0ff98
commit 92a28ad38a

View File

@ -38,7 +38,7 @@ empty :: OrderedMap key value
empty = OrderedMap []
union :: Eq key => OrderedMap key value -> OrderedMap key value -> OrderedMap key value
union (OrderedMap a) (OrderedMap b) = OrderedMap $ a ++ filter (not . (`elem` extant) . fst) b
union (OrderedMap a) (OrderedMap b) = OrderedMap $ a ++ filter ((`elem` extant) . fst) b
where extant = fst <$> a
unions :: Eq key => [OrderedMap key value] -> OrderedMap key value