No matching definitions.

tur/existential

stdlib/existential.tur

helpers for native pack/open existential types.

Since: Phase EX1

defmacro

showable

(showable [x])

pack a value as a Show-constrained existential.

xany value whose type implements the Show typeclass

A boxed existential of type (exists [a] [(Show a)] a). At runtime this is a tur_existential_t* carrying the value and a Show vtable pointer (see Phase EX1e).

(showable 42)
    ; => packed existential; opening it with show-it prints "42".

Since: Phase EX1f

defmacro

show-it

(show-it [s])

open a Show-constrained existential and call .show on

sa value of type (exists [a] [(Show a)] a) produced by showable

The :cstr produced by the Show instance attached to the underlying concrete type.

(show-it (showable 42))   ; => "42"
  (show-it (showable true)) ; => "true"  (requires Show [bool])

Since: Phase EX1f