jon.recoil.org

Module Extended.ScopedSource

Sourcetype ('a, 'k) inner = #{
  1. data : ('a, 'k) Data.t;
  2. password : 'k Capsule_prim__.Prim.Password.t;
}
Sourcetype 'a t =
  1. | P : ('a, 'k) inner -> 'a t

An encapsulated value accessible for the duration of the current region.

A value of type 'a Scoped.t provides uncontended access to the underlying 'a over a local scope.

Sourceval with_ : 'a -> f:('a t @ local -> 'b) @ local once -> 'b

with_ a ~f calls f with a local Scoped.t representing local access to a, which lives in the current capsule.

Sourceval get : 'a t @ local -> f:('a -> 'b @ portable contended) @ local once portable -> 'b @ portable contended

get t ~f computes a value using the data accessible via t.

Sourceval iter : 'a t @ local -> f:('a -> unit) @ local once portable -> unit

Like get, but for for functions that return unit.

Sourceval map : 'a t @ local -> f:('a -> 'b) @ local once portable -> 'b t @ local

Construct a new t by mapping a function over the referenced value.

Sourcemodule Shared : sig ... end