tur/typeclass-show
the Show typeclass, its primitive instances, and the
Since: Phase 15
Show[int]
(definstance Show [int])
Show instance for int.
Show[cstr]
(definstance Show [cstr])
Show instance for cstr (identity).
Show[bool]
(definstance Show [bool])
Show instance for bool.
Show[int8]
(definstance Show [int8])
Show instance for int8.
Show[int16]
(definstance Show [int16])
Show instance for int16.
Show[int32]
(definstance Show [int32])
Show instance for int32.
Show[uint8]
(definstance Show [uint8])
Show instance for uint8.
Show[uint16]
(definstance Show [uint16])
Show instance for uint16.
Show[uint32]
(definstance Show [uint32])
Show instance for uint32.
Show[uint64]
(definstance Show [uint64])
Show instance for uint64.
Show[float]
(definstance Show [float])
Show instance for float (double).
Show[float32]
(definstance Show [float32])
Show instance for float32.
Show[ptr<void>]
(definstance Show [ptr<void>])
Show instance for result<T,E> represented as ptr<void>.
show-concat
(show-concat [a : cstr b : cstr] :)
============================================================================
Since: Phase repl-show-collections
vec-show-loop
(vec-show-loop [^Show A])
accumulate the space-separated element repr for Show[Vec].
| v | Vec[A] | |
| i | current index (start at 0) | |
| len | element count (vec-len v) | |
| acc | repr accumulated so far ("" at the start) |
The space-separated concatenation of (show v[i]) for i in [i, len).
Since: Phase repl-show-collections
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
set-show-loop
(set-show-loop [^Show A])
accumulate the space-separated element repr for Show[Set].
| s | the Set[A] being shown (type witness for A; not otherwise read) | |
| iter | hamt/iter-alloc-allocated handle scanning the set | |
| first | true until the first element is emitted (separator control) | |
| acc | repr accumulated so far |
The space-separated concatenation of (show elem) over the set.
Since: Phase repl-show-collections
set-show-driver
(set-show-driver [^Show A])
allocate the iter box, run set-show-loop, free.
Since: Phase repl-show-collections
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
map-show-loop
(map-show-loop [^Show K ^Show V])
accumulate the "k v" pairs repr for Show[Map].
| m | the Map[K V] being shown (type witness for K and V; not read) | |
| iter | hamt/iter-alloc-allocated handle scanning the map | |
| first | true until the first entry is emitted (separator control) | |
| acc | repr accumulated so far |
The space-separated "k v" pairs over the map.
Since: Phase repl-show-collections
map-show-driver
(map-show-driver [^Show K ^Show V])
allocate the iter box, run map-show-loop, free.
Since: Phase repl-show-collections
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