mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Define maybeUnionRanges as a specialization of maybeConcat.
This commit is contained in:
parent
d6ec8d0d8c
commit
2ca378db0d
@ -74,7 +74,7 @@ unionRangesFrom range ranges = option range id . foldl mappend mempty $ Option .
|
|||||||
|
|
||||||
-- | Return Just the union of all the ranges in a Foldable, or else Nothing.
|
-- | Return Just the union of all the ranges in a Foldable, or else Nothing.
|
||||||
maybeUnionRanges :: Foldable f => f Range -> Maybe Range
|
maybeUnionRanges :: Foldable f => f Range -> Maybe Range
|
||||||
maybeUnionRanges ranges = getOption $ foldMap (Option . Just) ranges
|
maybeUnionRanges = maybeConcat
|
||||||
|
|
||||||
instance Monoid (Option Range) where
|
instance Monoid (Option Range) where
|
||||||
mempty = Option Nothing
|
mempty = Option Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user