reifyDag :: Traversable f => Tree f -> IO (Dag f)
reifyDag m = do (root, state) <- runStateT (findNodes m) init
                return (Dag root (rsEqs state) (rsNext state))
    where  init = ReifyState
                  { rsStable = HashMap.empty
                  , rsEqs = IntMap.empty
                  , rsNext = 0 }
reifyDag :: Traversable f => Tree f -> IO (Dag f)
reifyDag m = do (root, state) <- runStateT (findNodes m) init
                return (Dag root (rsEqs state) (rsNext state))
    where  init = ReifyState
                  { rsStable = HashMap.empty
                  , rsEqs = IntMap.empty
                  , rsNext = 0 }
reifyDag m = do (root, state) <- runStateT (findNodes m) init
                return (Dag root (rsEqs state) (rsNext state))
    where  init = ReifyState
                  { rsStable = HashMap.empty
                  , rsEqs = IntMap.empty
                  , rsNext = 0 }