From 6b211ac8bbade1f752a0a0548cd16015dd051f26 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 27 May 2016 10:23:38 -0400 Subject: [PATCH] Use applyToBoth to eliminate a fromJust. --- src/Alignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Alignment.hs b/src/Alignment.hs index f3d091982..3e6b2b67f 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -158,7 +158,7 @@ alignBranch getRange children ranges = case intersectingChildren of Just headRanges = headRangesOf ranges (leftRange, rightRange) = splitThese headRanges lineAndRemaining children ranges = let (intersections, remaining) = alignChildren getRange children ranges in - (fromJust ((,) <$> ranges `applyThese` Join (runBothWith These intersections)), remaining) + ((,) <$> ranges `applyToBoth` intersections, remaining) lineAndRemainingWhere predicate children = if any predicate children then Just . lineAndRemaining (filter predicate children) else const Nothing advancePast :: [Join These term] -> ([a] -> [a], [a] -> [a])