func (l *LinkedList) Update(n *Node, val int64) {
	n.val = val
}
Update will update the value for a given node
package linkedlist
var (
	zeroVal int64
	zeroSum int64
)
type LinkedList struct {
	head *Node
	tail *Node
	reporter bool
	len      int32
}
func (l *LinkedList) prepend(val int64) (n *Node) {
	n = newNode(nil, l.head, val)
	if l.head != nil {
		l.head.prev = n
	}
	if l.tail == nil {
		l.tail = n
	}
	l.head = n
	l.len++
	return
}
func (l *LinkedList) append(val int64) (n *Node) {
	n = newNode(l.tail, nil, val)
	if l.tail != nil {
		l.tail.next = n
	}
	if l.head == nil {
		l.head = n
	}
	l.tail = n
	l.len++
	return
}
func (l *LinkedList) mapCopy(fn MapFn) (nl *LinkedList) {
	nl = &LinkedList{reporter: true}
	l.ForEach(nil, func(n *Node, val int64) bool {
		nl.append(fn(val))
		return false
	})
	return
}
func (l *LinkedList) mapModify(fn MapFn) (nl *LinkedList) {
	nl = l
	l.ForEach(nil, func(n *Node, val int64) bool {
		n.val = fn(val)
		return false
	})
	return
}
func (l *LinkedList) filterCopy(fn FilterFn) (nl *LinkedList) {
	nl = &LinkedList{reporter: true}
	l.ForEach(nil, func(_ *Node, val int64) bool {
		if fn(val) {
			nl.append(val)
		}
		return false
	})
	return
}
func (l *LinkedList) filterModify(fn FilterFn) (nl *LinkedList) {
	nl = l
	l.ForEach(nil, func(n *Node, val int64) bool {
		if !fn(val) {
			l.Remove(n)
		}
		return false
	})
	return
}
func (l *LinkedList) Prepend(vals ...int64) {
	for _, val := range vals {
		l.prepend(val)
	}
	return
}
func (l *LinkedList) Append(vals ...int64) {
	for _, val := range vals {
		l.append(val)
	}
	return
}
func (l *LinkedList) Remove(n *Node) {
	if n.prev != nil {
		n.prev.next = n.next
	} else {
		if l.head = n.next; l.head != nil {
			l.head.prev = nil
		}
	}
	if n.next != nil {
		n.next.prev = n.prev
	} else {
		if l.tail = n.prev; l.tail != nil {
			l.tail.next = nil
		}
	}
	n.prev = nil
	n.next = nil
	n.val = zeroVal
	l.len--
}
func (l *LinkedList) ForEach(n *Node, fn ForEachFn) (ended bool) {
	if n == nil {
		n = l.head
	}
	var nn *Node
	for n != nil {
		nn = n.next
		if fn(n, n.val) {
			return true
		}
		n = nn
	}
	return false
}
func (l *LinkedList) ForEachRev(n *Node, fn ForEachFn) (ended bool) {
	if n == nil {
		n = l.tail
	}
	var pn *Node
	for n != nil {
		pn = n.prev
		if fn(n, n.val) {
			return true
		}
		n = pn
	}
	return false
}
func (l *LinkedList) Map(fn MapFn) (nl *LinkedList) {
	if l.reporter {
		return l.mapModify(fn)
	}
	return l.mapCopy(fn)
}
func (l *LinkedList) Filter(fn FilterFn) (nl *LinkedList) {
	if l.reporter {
		return l.filterModify(fn)
	}
	return l.filterCopy(fn)
}
func (l *LinkedList) Reduce(fn ReduceFn) (sum int64) {
	l.ForEach(nil, func(_ *Node, val int64) bool {
		sum = fn(sum, val)
		return false
	})
	return
}
func (l *LinkedList) Slice() (s []int64) {
	s = make([]int64, 0, l.len)
	l.ForEach(nil, func(_ *Node, val int64) bool {
		s = append(s, val)
		return false
	})
	return
}
func (l *LinkedList) Val(n *Node) (val int64) {
	return n.val
}