A primitive containing helper functions for constructing and testing Lists.
primitive val Lists[A: A]
new val create() : Lists[A] val^
Returns an empty list.
fun box empty() : (Cons[A] val | Nil[A] val)
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)
Builds a new list from an Array
fun box apply( arr: Array[val->A] ref) : (Cons[A] val | Nil[A] val)
Builds a new list from an iterator
fun box from( iter: Iterator[val->A] ref) : (Cons[A] val | Nil[A] 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 ?
fun box ne( that: Lists[A] val) : Bool val
© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/collections-persistent-Lists