No matching definitions.

tur/rc

stdlib/rc.tur

reference-counted pointer (rc<T>) for shared ownership.

rc<T> is an owning handle; rc-clone increments the count, rc-drop decrements.

Since: Phase 9

defn

rc-payload

(rc-payload [A])

read the value stored in an rc<A>.

Borrows its handle, so reading does not consume the caller's rc. v1 assumes the payload is a plain int64_t carrier.

rthe rc<A> to read (borrowed, not consumed)

The contained value. Zero for a null handle.

(let [r (rc/of 7)]
  (println (rc-payload r)))  ; => 7

Since: Phase HKT S6

definstance

Functor[rc]

(definstance Functor [rc])

Functor instance for rc<T>.

Since: Phase HKT H3

defclass

Foldable

(defclass Foldable [^t])

containers that can be reduced to a single summary value.

^tthe container's type constructor (kind * -> *)
(foldl [ta :(t a) init :b fn :(fn [b a] b)] :b)

combine the elements of ta first to last, starting from init

(foldr [ta :(t a) init :b fn :(fn [a b] b)] :b)

combine the elements of ta last to first, ending in init

The same class stdlib/typeclass.tur declares; declared here too so rc.tur stays standalone. An rc holds one value x, so its instance below is (fn init x) for foldl and (fn x init) for foldr.

rc

Since: Phase HKT S6

definstance

Foldable[rc]

(definstance Foldable [rc])

Foldable instance for rc<T>.

Since: Phase HKT S6

definstance

Clone[rc]

(definstance Clone [rc])

shallow-clone a TY_RC value by incrementing the strong refcount.

Since: Phase B1