toSimple :: Traversable f => Dag.Dag f -> Dag f
toSimple dag = Dag count (IntMap.insert count root edges) (count + 1)
  where (root, edges, count) = Dag.flatten dag

-- | Conversion from a simple 'Dag'. The resulting 'Dag.Dag' has a single node
-- in each tree segment.
toSimple :: Traversable f => Dag.Dag f -> Dag f
toSimple dag = Dag count (IntMap.insert count root edges) (count + 1)
  where (root, edges, count) = Dag.flatten dag

-- | Conversion from a simple 'Dag'. The resulting 'Dag.Dag' has a single node
-- in each tree segment.
toSimple dag = Dag count (IntMap.insert count root edges) (count + 1)
  where (root, edges, count) = Dag.flatten dag

-- | Conversion from a simple 'Dag'. The resulting 'Dag.Dag' has a single node
-- in each tree segment.