Documentation
¶
Index ¶
- func Append[T any](as1, as2 []T) []T
- func Appender[T any](s T, as []T) []T
- func Concat[A any](l [][]A) []A
- func Contains[T any](source []T, contains T, equality func(l, r T) bool) bool
- func ContainsAllOf[T any](source []T, contains []T, equality func(l, r T) bool) bool
- func Filter[T any](as []T, p func(T) bool) []T
- func FlatMap[T1, T2 any](as []T1, f func(T1) []T2) []T2
- func FoldRight[T1, T2 any](as []T1, z T2, f func(T1, T2) T2) T2
- func Map[T1, T2 any](as []T1, f func(T1) T2) []T2
- func Reverse[T1 any](xs []T1) []T1
- func SetEquality[T any](aa []T, bb []T, equality func(l, r T) bool) bool
- func SetIntersection[T any](a []T, b []T, equality func(l, r T) bool) []T
- func SetMinus[T any](a []T, b []T, equality func(l, r T) bool) []T
- func SetUnion[T any](a []T, b []T) []T
- func Zero[T any]() []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsAllOf ¶
func FlatMap ¶
func FlatMap[T1, T2 any](as []T1, f func(T1) []T2) []T2
Similar to Map in that it takes an array of T1 and applies a function to each element. But FlatMap is more powerful than map. We can use flatMap to generate a collection that is either larger or smaller than the original input.
func FoldRight ¶
func FoldRight[T1, T2 any](as []T1, z T2, f func(T1, T2) T2) T2
TODO make FoldLeft so you don't have to reverse the array at the end. Just like your linked list.
func Map ¶
func Map[T1, T2 any](as []T1, f func(T1) T2) []T2
A structure-preserving Functor on the given array of T.
func SetEquality ¶
func SetIntersection ¶
Returns the intersection of set 'a' and 'b'
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.