Ref

Definitions

def get(rf: Ref[a, r]): a \ rSource

Returns the element referenced by rf.

def new(rc: Region[r], x: a): Ref[a, r] \ rSource

Returns a new reference to x in the region rc.

def put(x: a, rf: Ref[a, r]): Unit \ rSource

Updates rf to reference x.

def transform(f: a -> a \ ef, rf: Ref[a, r]): Unit \ r + efSource

Updates rf to reference f applied to the value referenced by rf.

I.e. if rf references x then rf is updated to reference f(x).