Companion

object Companion

Properties

Link copied to clipboard
const val CONS_FUNCTOR: String

The canonical list-cell functor: . (same as Cons.FUNCTOR).

Link copied to clipboard

The canonical empty-list functor: [] (same as EmptyList.FUNCTOR).

Functions

Link copied to clipboard

Returns the empty logic list, i.e. the atom [].

Link copied to clipboard
fun from(items: Cursor<out Term>): List
fun from(items: List<Term>): List
fun from(vararg items: Term): List

Equivalent to from with last = null.

fun from(items: Cursor<out Term>, last: Term?): List

Creates a logic list lazily unfolding the given items, terminated by last.

fun from(items: Iterable<Term>, last: Term?): List

fun from(items: List<Term>, last: Term?): List

Creates a logic list containing items, in order, terminated by last.

fun from(items: Sequence<Term>, last: Term?): List

Creates a logic list containing items, in order, terminated by last. The list is unfolded lazily as it is consumed, which is useful for large or generated items sequences.

fun from(vararg items: Term, last: Term?): List

Creates a logic list containing items, in order, terminated by last. Passing null as last makes the last of items itself the final tail (still yielding a well-formed list only if that last item is EmptyList); passing any other Term (including a Var) yields a partial list.

Link copied to clipboard
fun of(items: Iterable<Term>): List
fun of(items: List<Term>): List
fun of(items: Sequence<Term>): List

fun of(vararg items: Term): List

Creates a well-formed logic list containing items, in order, terminated by EmptyList.