package ps
List is a persistent list of possibly heterogenous values.
IsNil returns true if the list is empty
	IsNil() bool
Cons returns a new list with val as the head
	Cons(val Any) List
Head returns the first element of the list; panics if the list is empty
	Head() Any
Tail returns a list with all elements except the head; panics if the list is empty
	Tail() List
Size returns the list's length. This takes O(1) time.
	Size() int
ForEach executes a callback for each value in the list.
	ForEach(f func(Any))
Reverse returns a list whose elements are in the opposite order as the original list.
	Reverse() List
}
Immutable (i.e. persistent) list
type list struct {
	depth int // the number of nodes after, and including, this one
	value Any
	tail  *list
}
An empty list shared by all lists
var nilList = &list{}
NewList returns a new, empty list. The result is a singly linked list implementation. All lists share an empty tail, so allocating empty lists is efficient in time and memory.
func () List {
	return nilList
}

func ( *list) () bool {
	return  == nilList
}

func ( *list) () int {
	return .depth
}

func ( *list) ( Any) List {
	var  list
	.depth = .depth + 1
	.value = 
	.tail = 
	return &
}

func ( *list) () Any {
	if .IsNil() {
		panic("Called Head() on an empty list")
	}

	return .value
}

func ( *list) () List {
	if .IsNil() {
		panic("Called Tail() on an empty list")
	}

	return .tail
}
ForEach executes a callback for each value in the list
func ( *list) ( func(Any)) {
	if .IsNil() {
		return
	}
	(.Head())
	.Tail().ForEach()
}
Reverse returns a list with elements in opposite order as this list
func ( *list) () List {
	 := NewList()
	.ForEach(func( Any) {  = .Cons() })
	return