Documentation ¶
Index ¶
- Constants
- func Templates() map[string][]string
- type ElementType
- type SliceSliceType
- type SliceType
- func (s SliceType) Abs() (out SliceType)
- func (s SliceType) All(f func(ElementType) bool) bool
- func (s SliceType) Any(f func(ElementType) bool) bool
- func (s SliceType) Average() float64
- func (s SliceType) Break(f func(ElementType) bool) (before SliceType, after SliceType)
- func (s SliceType) Delete(e ElementType) (out SliceType)
- func (s SliceType) Drop(i int) (out SliceType)
- func (s SliceType) DropWhile(f func(ElementType) bool) (out SliceType)
- func (s SliceType) Elem(el ElementType) bool
- func (s SliceType) Filter(f func(ElementType) bool) (out SliceType)
- func (s SliceType) Foldl(z ElementType, f func(e1, e2 ElementType) ElementType) (out ElementType)
- func (s SliceType) Foldl1(f func(e1, e2 ElementType) ElementType) (out ElementType)
- func (s SliceType) Foldr(e ElementType, f func(e1, e2 ElementType) ElementType) (out ElementType)
- func (s SliceType) Foldr1(f func(e1, e2 ElementType) ElementType) (out ElementType)
- func (s SliceType) Group() (out SliceSliceType)
- func (s SliceType) Head() (out ElementType)
- func (s SliceType) Init() (out SliceType)
- func (s SliceType) Inits() (out SliceSliceType)
- func (s SliceType) Intercalate(ss SliceSliceType) (out SliceType)
- func (s SliceType) Intersperse(value ElementType) (out SliceType)
- func (s SliceType) IsPrefixOf(in SliceType) bool
- func (s SliceType) Last() (out ElementType)
- func (s SliceType) Length() int
- func (s SliceType) Map(f func(ElementType) ElementType) (out SliceType)
- func (s SliceType) Maximum() (out ElementType)
- func (s SliceType) MaximumBy(f func(e1, e2 ElementType) ElementType) (max ElementType)
- func (s SliceType) Minimum() ElementType
- func (s SliceType) Modes() (out SliceType)
- func (s SliceType) Nub() (out SliceType)
- func (s SliceType) Null() bool
- func (s SliceType) Product() ElementType
- func (s SliceType) Reverse() (out SliceType)
- func (s SliceType) Scanl(e ElementType, f func(e1, e2 ElementType) ElementType) (out SliceType)
- func (s SliceType) Sort() SliceType
- func (s SliceType) Span(f func(ElementType) bool) (before SliceType, after SliceType)
- func (s SliceType) SplitAt(i int) (before, after SliceType)
- func (s SliceType) Sum() ElementType
- func (s SliceType) Tail() (out SliceType)
- func (s SliceType) Tails() (out SliceSliceType)
- func (s SliceType) Take(n uint64) (out SliceType)
- func (s SliceType) TakeWhile(p func(ElementType) bool) (out SliceType)
- func (s SliceType) Uncons() (head ElementType, tail SliceType)
- func (s SliceType) Unlines() (out string)
- func (s SliceType) Unwords() (out string)
- type Symbol
- type Template
Constants ¶
const ( ForNumbers = "ForNumbers" ForStrings = "ForStrings" ForStructs = "ForStructs" )
Types for which the function can be generated
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SliceType ¶
type SliceType []ElementType
SliceType represents a 1D slice.
func (SliceType) Abs ¶
Abs returns the absolute value of all elements in the slice. Can be generated for number-types.
func (SliceType) All ¶
func (s SliceType) All(f func(ElementType) bool) bool
All returns true if all elements of the slice satisfy the predicate. Can be generated for any type.
func (SliceType) Any ¶
func (s SliceType) Any(f func(ElementType) bool) bool
Any returns true if any of the elements satisfy the predicate. Can be generated for any type.
func (SliceType) Average ¶
Average returns the average of all elements in the slice. Can be generated for all number types.
func (SliceType) Break ¶
func (s SliceType) Break(f func(ElementType) bool) (before SliceType, after SliceType)
Break returns a tuple of any elements that do not satisfy the predicate up until the first time it passes, followed by the rest of the elements. Can be generated on any type.
func (SliceType) Delete ¶
func (s SliceType) Delete(e ElementType) (out SliceType)
Delete returns a slice with the first matching element removed from the slice. Can be generated for any type.
func (SliceType) Drop ¶
Drop returns a new Slice with the elements after the provided key. Can be generated for any type.
func (SliceType) DropWhile ¶
func (s SliceType) DropWhile(f func(ElementType) bool) (out SliceType)
DropWhile returns a new slice containing all elements after the predicate fails for the first time. Can be generated for any type.
func (SliceType) Elem ¶
func (s SliceType) Elem(el ElementType) bool
Elem returns true if the slice contains the element Can be generated for any type.
func (SliceType) Filter ¶
func (s SliceType) Filter(f func(ElementType) bool) (out SliceType)
Filter returns a slice containing only the elements that match the predicate. Can be generated for any type.
func (SliceType) Foldl ¶
func (s SliceType) Foldl(z ElementType, f func(e1, e2 ElementType) ElementType) (out ElementType)
Foldl reduces a list by iteratively applying f from left->right. Thus, for an empty slice, the result is the default zero-value.
func (SliceType) Foldl1 ¶
func (s SliceType) Foldl1(f func(e1, e2 ElementType) ElementType) (out ElementType)
Foldl1 reduces a list by iteratively applying f from left->right. Thus, for an empty slice, the result is the default zero-value.
func (SliceType) Foldr ¶
func (s SliceType) Foldr(e ElementType, f func(e1, e2 ElementType) ElementType) (out ElementType)
Foldr reduces a list by iteratively applying f from right -> left. Thus, for an empty slice, the result is the default zero-value.
func (SliceType) Foldr1 ¶
func (s SliceType) Foldr1(f func(e1, e2 ElementType) ElementType) (out ElementType)
Foldr1 reduces a list by iteratively applying f from right -> left. Thus, for an empty slice, the result is the default zero-value.
func (SliceType) Group ¶
func (s SliceType) Group() (out SliceSliceType)
Group returns a list of lists where each list contains only equal elements and the concatenation of the result is equal to the argument. Can be generated for any type.
func (SliceType) Head ¶
func (s SliceType) Head() (out ElementType)
Head returns the first element in the slice. If no element is found, returns the zero-value of the type. Can be generated for any type.
func (SliceType) Init ¶
Init takes n-1 elements from a slice, where n = len(list). Can be generated for any type.
func (SliceType) Inits ¶
func (s SliceType) Inits() (out SliceSliceType)
Inits returns all inits of a sequence, in order of small to large, as if it were called recursively. Can be generated for any type.
func (SliceType) Intercalate ¶
func (s SliceType) Intercalate(ss SliceSliceType) (out SliceType)
Intercalate inserts the method receiver slice into the function slice at each step. Can be generated for any type.
func (SliceType) Intersperse ¶
func (s SliceType) Intersperse(value ElementType) (out SliceType)
Intersperse inserts the receiving value between each element of the method receiver. Can be generated for any type.
func (SliceType) IsPrefixOf ¶
IsPrefixOf returns true if the current sliceType is a prefix of the passed one. Can be generated for any time.
func (SliceType) Last ¶
func (s SliceType) Last() (out ElementType)
Last returns the last element in the slice If no element is found, returns the zero-value of the type Can be generated for any type.
func (SliceType) Length ¶
Length returns the length (len) of a slice. Can be generated for any type.
func (SliceType) Map ¶
func (s SliceType) Map(f func(ElementType) ElementType) (out SliceType)
Map return a new slice with the map operation applied to each element. Can be generated for any type.
func (SliceType) Maximum ¶
func (s SliceType) Maximum() (out ElementType)
Maximum returns the maximum in a slice. Can be generated for number types.
func (SliceType) MaximumBy ¶
func (s SliceType) MaximumBy(f func(e1, e2 ElementType) ElementType) (max ElementType)
MaximumBy returns the maximum elements according to a custom comparator. Can be generated for any type.
func (SliceType) Minimum ¶
func (s SliceType) Minimum() ElementType
Minimum returns the minimum of a slice. Can be generated for number types.
func (SliceType) Modes ¶
Modes returns the elements with highest frequency in the slice. Can be generated for any type.
func (SliceType) Nub ¶
Nub returns a slice containing only the unique elements of the receiver. The order of the elements is preserved. Can be generated for any type.
func (SliceType) Product ¶
func (s SliceType) Product() ElementType
Product returns the product of all elements in the slice. Can be generated for any number type.
func (SliceType) Scanl ¶
func (s SliceType) Scanl(e ElementType, f func(e1, e2 ElementType) ElementType) (out SliceType)
Scanl reduces a list by iteratively applying f from left->right and then returns each iteration in a slice.
func (SliceType) Span ¶
func (s SliceType) Span(f func(ElementType) bool) (before SliceType, after SliceType)
Span returns a tuple of any elements that satisfy the predicate up until the first failure, followed by the rest of the elements. Can be generated for any type.
func (SliceType) SplitAt ¶
SplitAt splits the slice at the given index, returning before and after as a tuple. Can be generated for any type.
func (SliceType) Sum ¶
func (s SliceType) Sum() ElementType
Sum returns the sum of all elements in the slice. Can be generated for any number type.
func (SliceType) Tail ¶
Tail takes [1 -> n] elements from a slice, where n = len(list) Returns an empty slice if there are less than 2 elements in slice Can be generated for any type.
func (SliceType) Tails ¶
func (s SliceType) Tails() (out SliceSliceType)
Tails returns all tails of a sequence, in order of large to small, as if it were called recursively. Can be generated for any type.
func (SliceType) Take ¶
Take takes the first n elements of the slice, or the entire slice if n > len(slice). Can be generated for any type.
func (SliceType) TakeWhile ¶
func (s SliceType) TakeWhile(p func(ElementType) bool) (out SliceType)
TakeWhile continues appending to the output as long as the predicate is satisfied. Can be generated for any type.
func (SliceType) Uncons ¶
func (s SliceType) Uncons() (head ElementType, tail SliceType)
Uncons decomposes a slice into the head and tail component. Can be generated for any type.
Source Files ¶
- abs.go
- all.go
- any.go
- average.go
- break.go
- delete.go
- drop.go
- dropwhile.go
- elem.go
- filter.go
- foldl.go
- foldl1.go
- foldr.go
- foldr1.go
- group.go
- head.go
- init.go
- inits.go
- intercalate.go
- intersperse.go
- isprefixof.go
- last.go
- length.go
- main.go
- map.go
- maximum.go
- maximumby.go
- minimum.go
- modes.go
- nub.go
- null.go
- product.go
- reverse.go
- scanl.go
- sort.go
- span.go
- splitat.go
- sum.go
- tail.go
- tails.go
- take.go
- takewhile.go
- uncons.go
- unlines.go
- unwords.go