Since [bind] essentially allows one to add arbitrary edges to the DAG, one can use it to construct a cycle. [stabilize] will detect such cycles and raise

Quoting

Since [bind] essentially allows one to add arbitrary edges to the DAG, one can use it

to construct a cycle. [stabilize] will detect such cycles and raise.

Does someone have a minimal example of this ? This is not obvious to me at all. My intuition is, given OCaml’s lexical scoping rules, the obvious ways to create cycles are let rec and refs. It is not obvious to me at all how one creates a cycle merely with bind

Thanks!

Clarification: I’m asking about cycle in the Incremental DAG, not OCaml heap; in particular, it may be possible for Incremental to construct a cycle in the OCaml heap without constructing a cycle in the Incremental DAG.

1 Like

Yeah rec and refs seem like the most obvious way.

Check out this example here from the incremental test suite that uses a ref to create a cycle.

1 Like