def with_endpoints
import bendvy-ecs-core@0.1.0.3/state.bend as Stateimport Base
import capabilities.bend as Cap
30def with_endpoints(~H: Type,~Value: Data,~WriteError: Data,~equal: Value -> Value -> Bool,~read: Cap.Read<H,Value>,~write: Cap.Request<H,Value,WriteStatus<WriteError>>,owner: H,pair: Value & Value) -> H & Outcome<Value,WriteError>:
31 (+expected,+target) = pair
32 compare_set(~H,~Value,~WriteError,~equal,~read,~write,owner,expected,target)