No matching definitions.

tur/typeclass-show

stdlib/typeclass-show.tur

the Show typeclass, its primitive instances, and the

Since: Phase 15

definstance

Show[int]

(definstance Show [int])

Show instance for int.

definstance

Show[cstr]

(definstance Show [cstr])

Show instance for cstr (identity).

definstance

Show[bool]

(definstance Show [bool])

Show instance for bool.

definstance

Show[int8]

(definstance Show [int8])

Show instance for int8.

definstance

Show[int16]

(definstance Show [int16])

Show instance for int16.

definstance

Show[int32]

(definstance Show [int32])

Show instance for int32.

definstance

Show[uint8]

(definstance Show [uint8])

Show instance for uint8.

definstance

Show[uint16]

(definstance Show [uint16])

Show instance for uint16.

definstance

Show[uint32]

(definstance Show [uint32])

Show instance for uint32.

definstance

Show[uint64]

(definstance Show [uint64])

Show instance for uint64.

definstance

Show[float]

(definstance Show [float])

Show instance for float (double).

definstance

Show[float32]

(definstance Show [float32])

Show instance for float32.

definstance

Show[ptr<void>]

(definstance Show [ptr<void>])

Show instance for result<T,E> represented as ptr<void>.

defn

show-concat

(show-concat [a : cstr b : cstr] :)

============================================================================

Since: Phase repl-show-collections

defn

vec-show-loop

(vec-show-loop [^Show A])

accumulate the space-separated element repr for Show[Vec].

vVec[A]
icurrent index (start at 0)
lenelement count (vec-len v)
accrepr accumulated so far ("" at the start)

The space-separated concatenation of (show v[i]) for i in [i, len).

Since: Phase repl-show-collections

definstance

Show[Vec]

(definstance Show [Vec])

render a Vec[A] as "[a b c]" using the element's Show instance.

(show (vec-of 1 2 3))  ; => "[1 2 3]"
  (show (vec-new))       ; => "[]"

Since: Phase repl-show-collections

defn

set-show-loop

(set-show-loop [^Show A])

accumulate the space-separated element repr for Show[Set].

sthe Set[A] being shown (type witness for A; not otherwise read)
iterhamt/iter-alloc-allocated handle scanning the set
firsttrue until the first element is emitted (separator control)
accrepr accumulated so far

The space-separated concatenation of (show elem) over the set.

Since: Phase repl-show-collections

defn

set-show-driver

(set-show-driver [^Show A])

allocate the iter box, run set-show-loop, free.

Since: Phase repl-show-collections

definstance

Show[Set]

(definstance Show [Set])

render a Set[A] as "#set{a b c}" using the element's Show

(show (set-of 1 2 3))  ; => "#set{1 2 3}"

Since: Phase repl-show-collections

defn

map-show-loop

(map-show-loop [^Show K ^Show V])

accumulate the "k v" pairs repr for Show[Map].

mthe Map[K V] being shown (type witness for K and V; not read)
iterhamt/iter-alloc-allocated handle scanning the map
firsttrue until the first entry is emitted (separator control)
accrepr accumulated so far

The space-separated "k v" pairs over the map.

Since: Phase repl-show-collections

defn

map-show-driver

(map-show-driver [^Show K ^Show V])

allocate the iter box, run map-show-loop, free.

Since: Phase repl-show-collections

definstance

Show[Map]

(definstance Show [Map])

render a Map[K V] as "#map{k1 v1 k2 v2}" using the key and

(show (hamt-of 1 10 2 20))  ; => "#map{1 10 2 20}"

Since: Phase repl-show-collections