-- | Applies a function to every continuation label in a path.
mapContinues :: (c -> c') -> Path c b e a -> Path c' b e a
mapContinues f g = case g of
  Continue c   -> Continue $ f c
  x :>> xs     -> x :>> mapContinues f xs
  Branch b x y -> Branch b (mapContinues f x) (mapContinues f y)
  End e        -> End e

-- | Replaces continuation labels with numbers starting from 0.
mapContinues :: (c -> c') -> Path c b e a -> Path c' b e a
mapContinues f g = case g of
  Continue c   -> Continue $ f c
  x :>> xs     -> x :>> mapContinues f xs
  Branch b x y -> Branch b (mapContinues f x) (mapContinues f y)
  End e        -> End e

-- | Replaces continuation labels with numbers starting from 0.
mapContinues f g = case g of
  Continue c   -> Continue $ f c
  x :>> xs     -> x :>> mapContinues f xs
  Branch b x y -> Branch b (mapContinues f x) (mapContinues f y)
  End e        -> End e

-- | Replaces continuation labels with numbers starting from 0.