Documentation
¶
Index ¶
- type FilterFn
- type ForEachFn
- type GenericSum
- type GenericVal
- type LinkedList
- func (l *LinkedList) Append(vals ...GenericVal)
- func (l *LinkedList) Filter(fn FilterFn) (nl *LinkedList)
- func (l *LinkedList) ForEach(n *Node, fn ForEachFn) (ended bool)
- func (l *LinkedList) ForEachRev(n *Node, fn ForEachFn) (ended bool)
- func (l *LinkedList) Len() (n int32)
- func (l *LinkedList) Map(fn MapFn) (nl *LinkedList)
- func (l *LinkedList) Prepend(vals ...GenericVal)
- func (l *LinkedList) Reduce(fn ReduceFn) (sum GenericSum)
- func (l *LinkedList) Remove(n *Node)
- func (l *LinkedList) Slice() (s []GenericVal)
- func (l *LinkedList) Update(n *Node, val GenericVal)
- func (l *LinkedList) Val(n *Node) (val GenericVal)
- type MapFn
- type Node
- type ReduceFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterFn ¶
type FilterFn func(val GenericVal) (ok bool)
FilterFn is the format of the function used to call Filter
type ForEachFn ¶
type ForEachFn func(n *Node, val GenericVal) (end bool)
ForEachFn is the format of the function used to call ForEach
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
LinkedList is a simple doubly-linked list
func (*LinkedList) Append ¶
func (l *LinkedList) Append(vals ...GenericVal)
Append will append the list with a value, the reference Node is Returned
func (*LinkedList) Filter ¶
func (l *LinkedList) Filter(fn FilterFn) (nl *LinkedList)
Filter will return a filtered list
func (*LinkedList) ForEach ¶
func (l *LinkedList) ForEach(n *Node, fn ForEachFn) (ended bool)
ForEach will iterate through each node within the linked list
func (*LinkedList) ForEachRev ¶
func (l *LinkedList) ForEachRev(n *Node, fn ForEachFn) (ended bool)
ForEachRev will iterate through each node within the linked list in reverse
func (*LinkedList) Len ¶
func (l *LinkedList) Len() (n int32)
Len will return the current length of the linked list
func (*LinkedList) Map ¶
func (l *LinkedList) Map(fn MapFn) (nl *LinkedList)
Map will return a mapped list
func (*LinkedList) Prepend ¶
func (l *LinkedList) Prepend(vals ...GenericVal)
Prepend will prepend the list with a value, the reference Node is Returned
func (*LinkedList) Reduce ¶
func (l *LinkedList) Reduce(fn ReduceFn) (sum GenericSum)
Reduce will return a reduced value
func (*LinkedList) Remove ¶
func (l *LinkedList) Remove(n *Node)
Remove will remove a node from a list
func (*LinkedList) Slice ¶
func (l *LinkedList) Slice() (s []GenericVal)
Slice will return a slice of the current linked list
func (*LinkedList) Update ¶
func (l *LinkedList) Update(n *Node, val GenericVal)
Update will update the value for a given node
func (*LinkedList) Val ¶
func (l *LinkedList) Val(n *Node) (val GenericVal)
Val will return the value for a given node
type MapFn ¶
type MapFn func(val GenericVal) (nval GenericVal)
MapFn is the format of the function used to call Map
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a value container
type ReduceFn ¶
type ReduceFn func(acc, val GenericVal) (sum GenericSum)
ReduceFn is the format of the function used to call Reduce