No matching definitions.

tur/sized-handle-existential

stdlib/sized-handle-existential.tur
defmacro

pack-sized

(pack-sized [value-expr binder type-expr])

generic existential lift for phantom-indexed handles.

value-expra sized-handle value to seal
binderthe existential binder vector, e.g. [n]
type-exprthe body type mentioning the binder, e.g. (SizedBuf n)

A packed value of type (exists ~binder ~type-expr).

(pack-sized (sized-buf-new-zeroed 5) [n] (SizedBuf n))
    ; => packed SizedBuf; opening it recovers a fresh abstract n.

Since: Phase SZ8/P4

defmacro

open-sized

(open-sized [packed-expr n-name handle-name & body])

bind the hidden size index and the underlying handle.

packed-expra packed value (typically produced by pack-sized)
n-namesymbol that names the fresh abstract size index
handle-namesymbol that names the underlying sized handle
bodyone or more body forms evaluated in the binders' scope

The value of the last body form.

(open-sized packed n buf
    (println (sized-buf-len buf))
    (sized-buf-free buf))

Since: Phase SZ8/P4