diff --git a/src/Alignment.hs b/src/Alignment.hs index d052552f8..91bd90d8c 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -153,16 +153,20 @@ group2 ranges children | Just (headRanges, tailRanges) <- unconsThese ranges _ -> (tailRanges, children, [ flip (,) [] <$> headRanges ]) | ([]:rest) <- children = group2 ranges rest | otherwise = (ranges, children, []) - where advanceLeft (Join (These (_:as) bs)) = Join (These as bs) - advanceLeft (Join (This (_:as))) = Join (This as) - advanceLeft other = other - advanceRight (Join (These as (_:bs))) = Join (These as bs) - advanceRight (Join (That (_:bs))) = Join (That bs) - advanceRight other = other - pairRangesWithLine headRanges childLine = case (,) <$> headRanges `applyThese` childLine of + where pairRangesWithLine headRanges childLine = case (,) <$> headRanges `applyThese` childLine of Just v -> v Nothing -> error "oh god no" +advanceLeft :: Join These [a] -> Join These [a] +advanceLeft (Join (These (_:as) bs)) = Join (These as bs) +advanceLeft (Join (This (_:as))) = Join (This as) +advanceLeft other = other + +advanceRight :: Join These [a] -> Join These [a] +advanceRight (Join (These as (_:bs))) = Join (These as bs) +advanceRight (Join (That (_:bs))) = Join (That bs) +advanceRight other = other + {- find all of the lines which intersect with this child, not all the children intersecting with this line?