mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Define pairRangesWithLine
over a Monoid instance to be total.
This commit is contained in:
parent
8104f174ab
commit
1b1e88b4fd
@ -164,10 +164,8 @@ advanceRight (Join (These as (_:bs))) = Join (These as bs)
|
||||
advanceRight (Join (That (_:bs))) = Join (That bs)
|
||||
advanceRight other = other
|
||||
|
||||
pairRangesWithLine :: Join These a -> Join These b -> Join These (a, b)
|
||||
pairRangesWithLine headRanges childLine = case (,) <$> headRanges `applyThese` childLine of
|
||||
Just v -> v
|
||||
Nothing -> error "oh god no"
|
||||
pairRangesWithLine :: Monoid b => Join These a -> Join These b -> Join These (a, b)
|
||||
pairRangesWithLine headRanges childLine = fromMaybe (flip (,) mempty <$> headRanges) $ (,) <$> headRanges `applyThese` childLine
|
||||
|
||||
{-
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user