Lists[A: A]¶
A primitive containing helper functions for constructing and testing Lists.
primitive val Lists[A: A]
Constructors¶
create¶
new val create()
: Lists[A] val^
Returns¶
- Lists[A] val^
Public Functions¶
empty¶
Returns an empty list.
fun box empty()
: (Cons[A] val | Nil[A] val)
Returns¶
cons¶
Returns a list that has h as a head and t as a tail.
fun box cons(
h: val->A,
t: (Cons[A] val | Nil[A] val))
: (Cons[A] val | Nil[A] val)
Parameters¶
Returns¶
apply¶
Builds a new list from an Array
fun box apply(
arr: Array[val->A] ref)
: (Cons[A] val | Nil[A] val)
Parameters¶
- arr: Array[val->A] ref
Returns¶
from¶
Builds a new list from an iterator
fun box from(
iter: Iterator[val->A] ref)
: (Cons[A] val | Nil[A] val)
Parameters¶
- iter: Iterator[val->A] ref
Returns¶
eq[optional T: Equatable[T] val]¶
Checks whether two lists are equal.
fun box eq[optional T: Equatable[T] val](
l1: (Cons[T] val | Nil[T] val),
l2: (Cons[T] val | Nil[T] val))
: Bool val ?
Parameters¶
Returns¶
- Bool val ?
ne¶
fun box ne(
that: Lists[A] val)
: Bool val
Parameters¶
- that: Lists[A] val
Returns¶
- Bool val