unravelDag :: forall f. Functor f => Dag f -> Tree f
unravelDag g = build (root g)
    where build :: Node -> Tree f
          build n = In $ fmap build $ lookupNode n (edges g)
unravelDag :: forall f. Functor f => Dag f -> Tree f
unravelDag g = build (root g)
    where build :: Node -> Tree f
          build n = In $ fmap build $ lookupNode n (edges g)
unravelDag g = build (root g)
    where build :: Node -> Tree f
          build n = In $ fmap build $ lookupNode n (edges g)