getNonrangeMatch :: (ApplyMonad DefaultIO (ApplyState p), RepoPatch p, ApplyState p ~ Tree)
                 => Repository p wR wU wT
                 -> [MatchFlag]
                 -> IO ()
getNonrangeMatch r = withRecordedMatch r . getMatch where
  getMatch fs = case hasIndexRange fs of
    Just (n, m) | n == m -> applyNInv (n-1)
                | otherwise -> fail "Index range is not allowed for this command."
    _ -> getNonrangeMatchS fs
getNonrangeMatch :: (ApplyMonad DefaultIO (ApplyState p), RepoPatch p, ApplyState p ~ Tree)
                 => Repository p wR wU wT
                 -> [MatchFlag]
                 -> IO ()
getNonrangeMatch r = withRecordedMatch r . getMatch where
  getMatch fs = case hasIndexRange fs of
    Just (n, m) | n == m -> applyNInv (n-1)
                | otherwise -> fail "Index range is not allowed for this command."
    _ -> getNonrangeMatchS fs
getNonrangeMatch r = withRecordedMatch r . getMatch where
  getMatch fs = case hasIndexRange fs of
    Just (n, m) | n == m -> applyNInv (n-1)
                | otherwise -> fail "Index range is not allowed for this command."
    _ -> getNonrangeMatchS fs