W3cubDocs

/Pony

Lists[A: A]

[Source]

A primitive containing helper functions for constructing and testing Lists.

primitive val Lists[A: A]

Constructors

create

[Source]

new val create()
: Lists[A] val^

Returns

Public Functions

empty

[Source]

Returns an empty list.

fun box empty()
: (Cons[A] val | Nil[A] val)

Returns

cons

[Source]

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

  • h: val->A
  • t: (Cons[A] val | Nil[A] val)

Returns

apply

[Source]

Builds a new list from an Array

fun box apply(
  arr: Array[val->A] ref)
: (Cons[A] val | Nil[A] val)

Parameters

Returns

from

[Source]

Builds a new list from an iterator

fun box from(
  iter: Iterator[val->A] ref)
: (Cons[A] val | Nil[A] val)

Parameters

Returns

eq[optional T: Equatable[T] val]

[Source]

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

ne

[Source]

fun box ne(
  that: Lists[A] val)
: Bool val

Parameters

Returns

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/collections-persistent-Lists