-- | Removes any paths which only serve to continue on to another path.
cleanContinues :: (Ord c) => System c b e a -> System c b e a
cleanContinues sys = let
  toClean = [ c | (c, Continue c') <- Map.toList $ systemPaths sys, c /= c' ]
  in foldr unrollSystem sys toClean
cleanContinues :: (Ord c) => System c b e a -> System c b e a
cleanContinues sys = let
  toClean = [ c | (c, Continue c') <- Map.toList $ systemPaths sys, c /= c' ]
  in foldr unrollSystem sys toClean
cleanContinues sys = let
  toClean = [ c | (c, Continue c') <- Map.toList $ systemPaths sys, c /= c' ]
  in foldr unrollSystem sys toClean