Documentation
¶
Index ¶
- func All[A any](f F1[A, bool], xs []A) bool
- func And(xs []bool) bool
- func Any[A any](f F1[A, bool], xs []A) bool
- func Append[A any](xs []A, ys []A) []A
- func Break[A any](pred F1[A, bool], xs []A) *Pair[[]A, []A]
- func CompareBy[A any](comparisons ...Comparator[A]) Comparator[A]
- func CompareBys[A any](comparisons []Comparator[A]) Comparator[A]
- func ComparePair[A Ord[A], B Ord[B]](p1 *Pair[A, B], p2 *Pair[A, B]) Ordering
- func CompareSlice[A any](compare Comparator[A]) Comparator[[]A]
- func CompareSliceHelper[A any](compare Comparator[A], xs []A, ys []A) Ordering
- func Concat[A any](xss [][]A) []A
- func ConcatMap[A any, B any](f F1[A, []B], xs []A) []B
- func Cons[A any](a A, xs []A) []A
- func Drop[A any](count int, xs []A) []A
- func DropWhile[A any](pred F1[A, bool], xs []A) []A
- func EqualBy[A any](comparisons ...Equaler[A]) Equaler[A]
- func EqualBys[A any](comparisons []Equaler[A]) Equaler[A]
- func EqualPair[A Eq[A], B Eq[B]](p1 *Pair[A, B], p2 *Pair[A, B]) bool
- func EqualSlice[A any](compare F2[A, A, bool]) F2[[]A, []A, bool]
- func EqualSliceHelper[A any](compare F2[A, A, bool], xs []A, ys []A) bool
- func Filter[A any](f F1[A, bool], xs []A) []A
- func Find[A any](pred F1[A, bool], xs []A) *pkg.Maybe[A]
- func Foldl[A, B any](combine F2[B, A, B], base B, xs []A) B
- func Foldr[A, B any](combine F2[A, B, B], base B, xs []A) B
- func Group[A Eq[A]](xs []A) [][]A
- func GroupBy[A any](g F2[A, A, bool], xs []A) [][]A
- func Insert[A Ord[A]](a A, xs []A) []A
- func Intercalate[A any](sep []A, xss [][]A) []A
- func Intersperse[A any](sep A, xs []A) []A
- func Iterate[A any](count int, f F1[A, A], start A) []A
- func Length[A any](xs []A) int
- func Map[A, B any](f F1[A, B], xs []A) []B
- func MapAccumL[A, B, S any](accum F2[S, A, *Pair[S, B]], s S, xs []A) *Pair[S, []B]
- func MapAccumR[A, B, S any](accum F2[S, A, *Pair[S, B]], s S, xs []A) *Pair[S, []B]
- func Maximum[A Ord[A]](xs []A) *pkg.Maybe[A]
- func MaximumBy[A any](f Comparator[A], xs []A) *pkg.Maybe[A]
- func Merge[A any](xs []A, ys []A, compare Comparator[A]) []A
- func MergeSortWithComparator[A any](compare Comparator[A], xs []A) []A
- func Minimum[A Ord[A]](xs []A) *pkg.Maybe[A]
- func MinimumBy[A any](f Comparator[A], xs []A) *pkg.Maybe[A]
- func Null[A any](xs []A) bool
- func Or(xs []bool) bool
- func Partition[A any](predicate F1[A, bool], xs []A) *Pair[[]A, []A]
- func Product[A builtins.Number](xs []A) A
- func Range[A builtins.Number](start A, stop A, step A) []A
- func Replicate[A any](count int, a A) []A
- func Reverse[A any](xs []A) []A
- func Scanl[A, B any](combine F2[B, A, B], base B, xs []A) []B
- func Scanl1[A any](combine F2[A, A, A], xs []A) []A
- func Scanr[A, B any](combine F2[A, B, B], base B, xs []A) []B
- func Scanr1[A any](combine F2[A, A, A], xs []A) []A
- func Singleton[A any](a A) []A
- func Sort[A Ord[A]](xs []A) []A
- func SortBy[A any](compare Comparator[A], xs []A) []A
- func SortOn[A any, B Ord[B]](projection F1[A, B], xs []A) []A
- func SortOnBy[A any, B any](projection F1[A, B], compare Comparator[B], xs []A) []A
- func Span[A any](pred F1[A, bool], xs []A) *Pair[[]A, []A]
- func SplitAt[A any](count int, xs []A) *Pair[[]A, []A]
- func Sum[A builtins.Number](xs []A) A
- func Take[A any](count int, xs []A) []A
- func TakeWhile[A any](pred F1[A, bool], xs []A) []A
- func Uncons[A any](xs []A) *pkg.Maybe[*Pair[A, []A]]
- func Unfoldr[A, B any](f F1[B, *pkg.Maybe[*Pair[A, B]]], b B) []A
- func Unzip[A, B any](xs []*Pair[A, B]) *Pair[[]A, []B]
- func Zip[A, B any](xs []A, ys []B) []*Pair[A, B]
- func ZipWith[A, B, C any](f F2[A, B, C], xs []A, ys []B) []C
- type SliceEq
- type SliceOrd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
All is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:all
func And ¶
And is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:and
func Any ¶
Any is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:any
func Append ¶
func Append[A any](xs []A, ys []A) []A
Append is from (++):
https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:-43--43-
func Break ¶
Break is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:break
func CompareBys ¶
func CompareBys[A any](comparisons []Comparator[A]) Comparator[A]
func ComparePair ¶
func ComparePair[A Ord[A], B Ord[B]](p1 *Pair[A, B], p2 *Pair[A, B]) Ordering
func CompareSlice ¶
func CompareSlice[A any](compare Comparator[A]) Comparator[[]A]
func CompareSliceHelper ¶
func CompareSliceHelper[A any](compare Comparator[A], xs []A, ys []A) Ordering
CompareSliceHelper should work as in Haskell. Examples from Haskell:
Prelude> [1,2,3] < [3,4,5] True Prelude> [1,2,3] < [3,4] True Prelude> [1,2,3] < [] False
func Concat ¶
func Concat[A any](xss [][]A) []A
Concat is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:concat
func ConcatMap ¶
ConcatMap is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:concatMap
func Cons ¶
func Cons[A any](a A, xs []A) []A
Cons prepends an element to a slice. This implementation may be inefficient.
func Drop ¶
Drop is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:drop
func DropWhile ¶
DropWhile is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:dropWhile
func EqualSlice ¶
func EqualSliceHelper ¶
func Filter ¶
Filter is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:filter
func Find ¶
Find is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:find
func Foldl ¶
func Foldl[A, B any](combine F2[B, A, B], base B, xs []A) B
Foldl is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:foldl
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
func Foldr ¶
func Foldr[A, B any](combine F2[A, B, B], base B, xs []A) B
Foldr is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:foldr
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
func Group ¶
func Group[A Eq[A]](xs []A) [][]A
Group is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:group
func GroupBy ¶
GroupBy is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:groupBy
func Insert ¶
func Insert[A Ord[A]](a A, xs []A) []A
Insert is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:insert
func Intercalate ¶
func Intercalate[A any](sep []A, xss [][]A) []A
Intercalate is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:intercalate
func Intersperse ¶
func Intersperse[A any](sep A, xs []A) []A
Intersperse is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:intersperse
func Iterate ¶
Iterate is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:iterate
it uses a count to avoid an infinite slice
func Length ¶
Length is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:length
func Map ¶
func Map[A, B any](f F1[A, B], xs []A) []B
Map is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:map
func MapAccumL ¶
func MapAccumL[A, B, S any](accum F2[S, A, *Pair[S, B]], s S, xs []A) *Pair[S, []B]
MapAccumL is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:mapAccumL
forall t s a b. Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)
func MapAccumR ¶
func MapAccumR[A, B, S any](accum F2[S, A, *Pair[S, B]], s S, xs []A) *Pair[S, []B]
MapAccumR is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:mapAccumR
forall t s a b. Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)
func Maximum ¶
Maximum is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:maximum
since Haskell's maximum blows up on empty lists, this has been modified for safety
func MaximumBy ¶
MaximumBy is from https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:maximumBy
func MergeSortWithComparator ¶
func MergeSortWithComparator[A any](compare Comparator[A], xs []A) []A
MergeSortWithComparator needs to be rewritten iteratively TODO
func Minimum ¶
Minimum is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:minimum
since Haskell's minimum blows up on empty lists, this has been modified for safety
func MinimumBy ¶
MinimumBy is from https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:minimumBy
func Null ¶
Null is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:null
func Partition ¶
Partition is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:partition
func Product ¶
Product is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:product
func Replicate ¶
Replicate is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:replicate
func Reverse ¶
func Reverse[A any](xs []A) []A
Reverse is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:reverse
func Scanl ¶
func Scanl[A, B any](combine F2[B, A, B], base B, xs []A) []B
Scanl is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:scanl
func Scanl1 ¶
func Scanl1[A any](combine F2[A, A, A], xs []A) []A
Scanl1 is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:scanl1
func Scanr ¶
func Scanr[A, B any](combine F2[A, B, B], base B, xs []A) []B
Scanr is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:scanr
func Scanr1 ¶
func Scanr1[A any](combine F2[A, A, A], xs []A) []A
Scanr1 is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:scanr1
func Singleton ¶
func Singleton[A any](a A) []A
Singleton is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:singleton
func Sort ¶
func Sort[A Ord[A]](xs []A) []A
Sort is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:sort
It orders elements by their natural Ord instance.
func SortBy ¶
func SortBy[A any](compare Comparator[A], xs []A) []A
SortBy is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:sortBy
It allows sorting based on a custom comparison operator; therefore it does not require input elements to have an Ord instance.
func SortOn ¶
func SortOn[A any, B Ord[B]](projection F1[A, B], xs []A) []A
SortOn is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:sortOn
It uses the decorate/sort/undecorate pattern. It allows a projection of each element to be used to determine the order. The projection must have an Ord instance.
func SortOnBy ¶
SortOnBy combines the functionality of `SortOn` and `SortBy`,
thereby separating projection and comparison functions
func Span ¶
Span is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:span
func SplitAt ¶
SplitAt is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:splitAt
func Sum ¶
Sum is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:sum
func Take ¶
Take is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:take
func TakeWhile ¶
TakeWhile is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:takeWhile
func Uncons ¶
Uncons is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:uncons
func Unfoldr ¶
Unfoldr is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:unfoldr
func Unzip ¶
func Unzip[A, B any](xs []*Pair[A, B]) *Pair[[]A, []B]
Unzip is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:unzip
func Zip ¶
func Zip[A, B any](xs []A, ys []B) []*Pair[A, B]
Zip is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:zip
func ZipWith ¶
func ZipWith[A, B, C any](f F2[A, B, C], xs []A, ys []B) []C
ZipWith is from: https://hackage.haskell.org/package/base-4.16.2.0/docs/Data-List.html#v:zipWith