@@ -315,14 +315,22 @@ toRelevantBranch test path branch@(Branch goal pathPatterns) =
315315 case extract path pathPatterns of
316316 Just (start, A.A _ pattern, end) ->
317317 case pattern of
318− P.Data name patterns | test == Constructor name ->
319− Just (Branch goal (start ++ subPositions path patterns ++ end))
318+ P.Data name patterns ->
319+ if test == Constructor name then
320+ Just (Branch goal (start ++ subPositions path patterns ++ end))
320321
321− P.Literal lit | test == Literal lit ->
322− Just (Branch goal (start ++ end))
322+ else
323+ Nothing
324+
325+ P.Literal lit ->
326+ if test == Literal lit then
327+ Just (Branch goal (start ++ end))
328+
329+ else
330+ Nothing
323331
324332 _ ->
325− Nothing
333+ Just branch
326334
327335 _ ->
328336 Just branch