unroll :: (Eq c) => c -> Path c b e a -> Path c b e a -> Path c b e a
unroll cfrom gto = go where
  go g = case g of
    v :>> x                 -> v    :>> go x
    Branch b x y            -> Branch b (go x) (go y)
    Continue c | c == cfrom -> gto
    _                       -> g

-- | Applies a function to every path inside a system.
unroll :: (Eq c) => c -> Path c b e a -> Path c b e a -> Path c b e a
unroll cfrom gto = go where
  go g = case g of
    v :>> x                 -> v    :>> go x
    Branch b x y            -> Branch b (go x) (go y)
    Continue c | c == cfrom -> gto
    _                       -> g

-- | Applies a function to every path inside a system.
unroll cfrom gto = go where
  go g = case g of
    v :>> x                 -> v    :>> go x
    Branch b x y            -> Branch b (go x) (go y)
    Continue c | c == cfrom -> gto
    _                       -> g

-- | Applies a function to every path inside a system.