Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Data/Map/Ordered/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ instance (Ord k, Semigroup v) => Semigroup (Bias R (OMap k v)) where
-- @since 0.2
instance (Ord k, Monoid v) => Monoid (Bias L (OMap k v)) where
mempty = Bias empty
#if !MIN_VERSION_base(4,11,0)
mappend (Bias o) (Bias o') = Bias (unionWithL (const mappend) o o')
#endif

-- | Empty maps and map union. When combining two sets that share elements, the
-- indices of the right argument are preferred, and the values are combined
Expand All @@ -102,7 +104,9 @@ instance (Ord k, Monoid v) => Monoid (Bias L (OMap k v)) where
-- @since 0.2
instance (Ord k, Monoid v) => Monoid (Bias R (OMap k v)) where
mempty = Bias empty
#if !MIN_VERSION_base(4,11,0)
mappend (Bias o) (Bias o') = Bias (unionWithR (const mappend) o o')
#endif

-- | Values are traversed in insertion order, not key order.
--
Expand Down
4 changes: 4 additions & 0 deletions Data/Set/Ordered.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ instance Ord a => Semigroup (Bias R (OSet a)) where Bias o <> Bias o' = Bias (o
-- @since 0.2
instance Ord a => Monoid (Bias L (OSet a)) where
mempty = Bias empty
#if !MIN_VERSION_base(4,11,0)
mappend (Bias o) (Bias o') = Bias (o |<> o')
#endif

-- | Empty sets and set union. When combining two sets that share elements, the
-- indices of the right argument are preferred.
Expand All @@ -113,7 +115,9 @@ instance Ord a => Monoid (Bias L (OSet a)) where
-- @since 0.2
instance Ord a => Monoid (Bias R (OSet a)) where
mempty = Bias empty
#if !MIN_VERSION_base(4,11,0)
mappend (Bias o) (Bias o') = Bias (o <>| o')
#endif

infixr 5 <|, |< -- copy :
infixl 5 >|, |>
Expand Down