list

package
v0.0.0-...-c2e7105 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Foldl

func Foldl(f func(carry interface{}, elem interface{}) interface{}, val interface{}, l List) interface{}

Foldl performs a left fold over the list

func Foldl1

func Foldl1(f func(interface{}, interface{}) interface{}, l List) interface{}

Foldl1 performs a left fold over the list using it's head as the initial element

func Foldr

func Foldr(f func(interface{}, interface{}) interface{}, val interface{}, l List) interface{}

Foldr performs a right fold over the list

func Head(l List) interface{}

Head returns the value from the front of the list

func Index

func Index(idx uint, l List) interface{}

Index gets the specified element from the list (0-indexed)

func IsEmpty

func IsEmpty(l List) bool

IsEmpty returns true if the list is empty

func MapM

func MapM(f func(interface{}), l List)

MapM applies f to each element then evaluates each function in sequence

func Seq

func Seq(l List)

Seq evaluates each function in the list

func ToSlice

func ToSlice(l List) []interface{}

ToSlice returns a slice of evaluated values from the list

Types

type List

type List interface{}

List represents a lazily evaluated list type

func Append

func Append(i interface{}, l List) List

Append adds an element to the end of the list

func Concat

func Concat(back, front List) List

Concat joins two lists

func Cons

func Cons(i interface{}, l List) List

Cons pushes an element onto the fron of the list

func Consf

func Consf(f func() interface{}, l List) List

Consf pushes an element-generating function onto the list

func HdTail

func HdTail(l List) (interface{}, List)

HdTail returns (Head l, Tail l)

func Map

func Map(f func(interface{}) interface{}, l List) List

Map returns a list with f (lazily) applied to each element

func Mzero

func Mzero() List

Mzero returnes an empty list

func New

func New(elems ...interface{}) List

New generates a List from any number of elements

func Return

func Return(i interface{}) List

Return returns a single-element list

func Returnf

func Returnf(f func() interface{}) List

Returnf creates a list with a single element-generating function

func Reverse

func Reverse(l List) List

Reverse returns the list revsersed

func Tail

func Tail(l List) List

Tail returns the list without the front element

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL