effect-io-ai

Package: effect
Module: Graph

Graph.beginMutation

Creates a mutable scope for safe graph mutations by copying the data structure.

Example

import { Graph } from "effect"

const graph = Graph.directed<string, number>()
const mutable = Graph.beginMutation(graph)
// Now mutable can be safely modified without affecting original graph

Signature

declare const beginMutation: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T>) => MutableGraph<N, E, T>

Source

Since v3.18.0