Module Cell

Shared cells.

type Cell<a> = iterative choice {
  .end => ?,
  .split(dual self) => self,
  .take => (a) choice {
    .put(a) => self,
  },
}

A shared cell containing a value.

  • .end — release the cell.
  • .split — create another handle to the same cell.
  • .take — remove the current value and continue by choosing .put.
dec Cell.Share : <a>[a] [dual Cell<a>] a

Serves a value through a Cell. Returns the final value when all clients are done.