extract :: GraphT s a b -> GraphT s a (b, JStat -> JStat)
extract gr = do
    oldSt <- get
    clear
    gr' <- gr
    newStat <- use jstat
    seed <- use varSeed
    put oldSt
    varSeed .= seed
    return (gr', newStat)

-- | The compliment to extract, `insert` appends a snippet of `JStat`
--   to the state of the current `Graph`.
extract :: GraphT s a b -> GraphT s a (b, JStat -> JStat)
extract gr = do
    oldSt <- get
    clear
    gr' <- gr
    newStat <- use jstat
    seed <- use varSeed
    put oldSt
    varSeed .= seed
    return (gr', newStat)

-- | The compliment to extract, `insert` appends a snippet of `JStat`
--   to the state of the current `Graph`.
extract gr = do
    oldSt <- get
    clear
    gr' <- gr
    newStat <- use jstat
    seed <- use varSeed
    put oldSt
    varSeed .= seed
    return (gr', newStat)

-- | The compliment to extract, `insert` appends a snippet of `JStat`
--   to the state of the current `Graph`.