    -- a member of the graph.
    maybeVertex :: k -> Maybe G.Vertex }

-- | The node for the given key.  Return Nothing if the key is not
-- a member of the graph.
maybeNode :: DAG k v -> k -> Maybe v
maybeNode DAG{..} k = _1 . nodeDesc <$> maybeVertex k
{-# INLINE maybeNode #-}

-- | The edge list for the given key.  Return Nothing if the key is not
-- a member of the graph.
maybeEdges :: DAG k v -> k -> Maybe [k]
maybeEdges DAG{..} k = _3 . nodeDesc <$> maybeVertex k
{-# INLINE maybeEdges #-}