Source File
list.go
Belonging Package
src.elv.sh/pkg/persistent/list
// Package list implements persistent list.package list// List is a persistent list.type List interface {// Len returns the number of values in the list.Len() int// Cons returns a new list with an additional value in the front.Cons(interface{}) List// First returns the first value in the list.First() interface{}// Rest returns the list after the first value.Rest() List}// Empty is an empty list.var Empty List = &list{}type list struct {first interface{}rest *listcount int}func ( *list) () int {return .count}func ( *list) ( interface{}) List {return &list{, , .count + 1}}func ( *list) () interface{} {return .first}func ( *list) () List {return .rest}
The pages are generated with Golds v0.2.8-preview. (GOOS=darwin GOARCH=arm64)