package ps

Import Path
	github.com/lann/ps (on go.dev)

Dependency Relation
	imports 2 packages, and imported by one package

Involved Source Files list.go Fully persistent data structures. A persistent data structure is a data structure that always preserves the previous version of itself when it is modified. Such data structures are effectively immutable, as their operations do not update the structure in-place, but instead always yield a new structure. Persistent data structures typically share structure among themselves. This allows operations to avoid copying the entire data structure.
Package-Level Type Names (total 5, in which 3 are exported)
/* sort exporteds by: | */
Any is a shorthand for Go's verbose interface{} type. func List.Head() Any func Map.Lookup(key string) (Any, bool) func List.Cons(val Any) List func Map.Set(key string, value Any) Map
List is a persistent list of possibly heterogenous values. Cons returns a new list with val as the head ForEach executes a callback for each value in the list. Head returns the first element of the list; panics if the list is empty IsNil returns true if the list is empty Reverse returns a list whose elements are in the opposite order as the original list. Size returns the list's length. This takes O(1) time. Tail returns a list with all elements except the head; panics if the list is empty func NewList() List func List.Cons(val Any) List func List.Reverse() List func List.Tail() List
A Map associates unique keys (type string) with values (type Any). Delete returns a new map with the association for key, if any, removed. This operation is O(log N) in the number of keys. ForEach executes a callback on each key value pair in the map. IsNil returns true if the Map is empty Keys returns a slice with all keys in this map. This operation is O(N) in the number of keys. Lookup returns the value associated with a key, if any. If the key exists, the second return value is true; otherwise, false. This operation is O(log N) in the number of keys. Set returns a new map in which key and value are associated. If the key didn't exist before, it's created; otherwise, the associated value is changed. This operation is O(log N) in the number of keys. Size returns the number of key value pairs in the map. This takes O(1) time. ( T) String() string T : expvar.Var T : fmt.Stringer func NewMap() Map func Map.Delete(key string) Map func Map.Set(key string, value Any) Map
Package-Level Functions (total 8, in which 2 are exported)
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.
NewMap allocates a new, persistent map from strings to values of any type. This is currently implemented as a path-copying binary tree.
Package-Level Variables (total 2, neither is exported)
Package-Level Constants (total 4, none are exported)