tur/list-typed
a phantom-typed (List A) view over the int64 cons-list
Since: end-to-end-monomorphization-plan (Phase 1.1)
List
(List [A] :int))
a typed view over the int64 cons-list carrier, carrying a phantom
Since: end-to-end-monomorphization-plan (Phase 1.1)
list-of
(list-of [A])
build a (List A) from N values, recovering A from the rest type.
| & xs -- zero or more elements, all of type A. |
A (List A) over the int64 cons-list carrier the variadic collector builds. With zero arguments, the empty list (carrier 0).
(list-empty? (list-of)) ; => true (list-empty? (list-of 1 2)) ; => false
Since: end-to-end-monomorphization-plan (Phase 1.1)
list-empty?
(list-empty? [A])
is a (List A) the empty list?
| xs | the (List A) to inspect |
true when xs is empty (carrier 0), false otherwise.
(list-empty? (list-of)) ; => true (list-empty? (list-of 9)) ; => false
Since: end-to-end-monomorphization-plan (Phase 1.1)
list->carrier
(list->carrier [A])
recover the raw int64 cons-list carrier from a (List A).
| xs | the (List A) to unwrap |
The underlying int64 cons-list pointer (0 for empty), suitable as input to the untyped carrier helpers (list-head, list-tail, list-length, ...).
(list-head (list->carrier (list-of 7 8))) ; => 7
Since: end-to-end-monomorphization-plan (Phase 1.1)
list-count
(list-count [A])
number of elements in a (List A), correct for aggregate A.
| xs | the (List A) to measure |
Integer length (0 for the empty list).
(list-count (list-of 1 2 3)) ; => 3
Since: Phase G4 (carrier<->concrete ABI crossing audit)