{- | Updates the depgraph at the given key with the update function.
The dependencies are NOT recomputed. No new elements are added to the graph. -}
updateValue :: Ord a => DepGraph a b c -> (b -> b) -> a -> DepGraph a b c
updateValue gr uf key = gr { dataMap = Map.adjust uf' key $ dataMap gr } where
    uf' (x, y, z) = (uf x, y, z)


{- | Updates the depgraph at the given key with the new value.
The dependencies are recomputed. If the key does not exist in the graph
it is added to the graph. -}
updateValue :: Ord a => DepGraph a b c -> (b -> b) -> a -> DepGraph a b c
updateValue gr uf key = gr { dataMap = Map.adjust uf' key $ dataMap gr } where
    uf' (x, y, z) = (uf x, y, z)


{- | Updates the depgraph at the given key with the new value.
The dependencies are recomputed. If the key does not exist in the graph
it is added to the graph. -}
updateValue gr uf key = gr { dataMap = Map.adjust uf' key $ dataMap gr } where
    uf' (x, y, z) = (uf x, y, z)


{- | Updates the depgraph at the given key with the new value.
The dependencies are recomputed. If the key does not exist in the graph
it is added to the graph. -}