types

package module
Version: v0.0.0-...-ea2659f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package types contains code generated by hasgo. [DO NOT EDIT!]

Package types contains code generated by hasgo. [DO NOT EDIT!]

Package types contains code generated by hasgo. [DO NOT EDIT!]

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bools

type Bools []bool

Bools represents an array of booleans

func (Bools) And

func (bs Bools) And() bool

And returns true if all bools are true

func (Bools) Or

func (bs Bools) Or() bool

Or returns true if any value is true

type Int

type Int int64

Int is a wrapper around int64

type Ints

type Ints []int64

Ints is a wrapper around []int64

func IntRange

func IntRange(start, stop int64) Ints

IntRange creates a range similar to list comprehension in Haskell Ranges in Haskell are _inclusive_ on both bounds. IntRange(0,10) == [0..10] == []int{0,1,2,3,4,5,6,7,8,9,10}

func IntReplicate

func IntReplicate(count uint64, value int64) (out Ints)

IntReplicate creates a slice with `value` repeated `count` times

func (Ints) Abs

func (s Ints) Abs() (out Ints)

Abs returns the absolute value of all elements in the slice. Can be generated for number-types.

func (Ints) All

func (s Ints) All(f func(int64) bool) bool

All returns true if all elements of the slice satisfy the predicate. Can be generated for any type.

func (Ints) Any

func (s Ints) Any(f func(int64) bool) bool

Any returns true if any of the elements satisfy the predicate. Can be generated for any type.

func (Ints) Average

func (s Ints) Average() float64

Average returns the average of all elements in the slice. Can be generated for all number types.

func (Ints) Break

func (s Ints) Break(f func(int64) bool) (before Ints, after Ints)

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 (Ints) Delete

func (s Ints) Delete(e int64) (out Ints)

Delete returns a slice with the first matching element removed from the slice. Can be generated for any type.

func (Ints) Drop

func (s Ints) Drop(i int) (out Ints)

Drop returns a new Slice with the elements after the provided key. Can be generated for any type.

func (Ints) DropWhile

func (s Ints) DropWhile(f func(int64) bool) (out Ints)

DropWhile returns a new slice containing all elements after the predicate fails for the first time. Can be generated for any type.

func (Ints) Elem

func (s Ints) Elem(el int64) bool

Elem returns true if the slice contains the element Can be generated for any type.

func (Ints) Equals

func (is Ints) Equals(other Ints) bool

Equals verifies that both slices have the same elements, ignoring their position.

func (Ints) EqualsOrdered

func (is Ints) EqualsOrdered(other Ints) bool

EqualsOrdered verifies that the elements in the slices are equal (same position)

func (Ints) Filter

func (s Ints) Filter(f func(int64) bool) (out Ints)

Filter returns a slice containing only the elements that match the predicate. Can be generated for any type.

func (Ints) Foldl

func (s Ints) Foldl(z int64, f func(e1, e2 int64) int64) (out int64)

Foldl reduces a list by iteratively applying f from left->right. Thus, for an empty slice, the result is the default zero-value.

func (Ints) Foldl1

func (s Ints) Foldl1(f func(e1, e2 int64) int64) (out int64)

Foldl1 reduces a list by iteratively applying f from left->right. Thus, for an empty slice, the result is the default zero-value.

func (Ints) Foldr

func (s Ints) Foldr(e int64, f func(e1, e2 int64) int64) (out int64)

Foldr reduces a list by iteratively applying f from right -> left. Thus, for an empty slice, the result is the default zero-value.

func (Ints) Foldr1

func (s Ints) Foldr1(f func(e1, e2 int64) int64) (out int64)

Foldr1 reduces a list by iteratively applying f from right -> left. Thus, for an empty slice, the result is the default zero-value.

func (Ints) Group

func (s Ints) Group() (out [][]int64)

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 (Ints) Head

func (s Ints) Head() (out int64)

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 (Ints) Init

func (s Ints) Init() (out Ints)

Init takes n-1 elements from a slice, where n = len(list). Can be generated for any type.

func (Ints) Inits

func (s Ints) Inits() (out [][]int64)

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 (Ints) Intercalate

func (s Ints) Intercalate(ss [][]int64) (out Ints)

Intercalate inserts the method receiver slice into the function slice at each step. Can be generated for any type.

func (Ints) Intersperse

func (s Ints) Intersperse(value int64) (out Ints)

Intersperse inserts the receiving value between each element of the method receiver. Can be generated for any type.

func (Ints) IsPrefixOf

func (s Ints) IsPrefixOf(in Ints) bool

IsPrefixOf returns true if the current sliceType is a prefix of the passed one. Can be generated for any time.

func (Ints) Last

func (s Ints) Last() (out int64)

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 (Ints) Length

func (s Ints) Length() int

Length returns the length (len) of a slice. Can be generated for any type.

func (Ints) Map

func (s Ints) Map(f func(int64) int64) (out Ints)

Map return a new slice with the map operation applied to each element. Can be generated for any type.

func (Ints) Maximum

func (s Ints) Maximum() (out int64)

Maximum returns the maximum in a slice. Can be generated for number types.

func (Ints) MaximumBy

func (s Ints) MaximumBy(f func(e1, e2 int64) int64) (max int64)

MaximumBy returns the maximum elements according to a custom comparator. Can be generated for any type.

func (Ints) Minimum

func (s Ints) Minimum() int64

Minimum returns the minimum of a slice. Can be generated for number types.

func (Ints) Modes

func (s Ints) Modes() (out Ints)

Modes returns the elements with highest frequency in the slice. Can be generated for any type.

func (Ints) Nub

func (s Ints) Nub() (out Ints)

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 (Ints) Null

func (s Ints) Null() bool

Null returns true the slice is empty. Can be generated for any type.

func (Ints) Product

func (s Ints) Product() int64

Product returns the product of all elements in the slice. Can be generated for any number type.

func (Ints) Reverse

func (s Ints) Reverse() (out Ints)

Reverse returns the reversed slice. Can be generated for any type.

func (Ints) Scanl

func (s Ints) Scanl(e int64, f func(e1, e2 int64) int64) (out Ints)

Scanl reduces a list by iteratively applying f from left->right and then returns each iteration in a slice.

func (Ints) Sort

func (s Ints) Sort() Ints

Sort is a wrapper around go sort function. Can be generated for any type.

func (Ints) Span

func (s Ints) Span(f func(int64) bool) (before Ints, after Ints)

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 (Ints) SplitAt

func (s Ints) SplitAt(i int) (before, after Ints)

SplitAt splits the slice at the given index, returning before and after as a tuple. Can be generated for any type.

func (Ints) Sum

func (s Ints) Sum() int64

Sum returns the sum of all elements in the slice. Can be generated for any number type.

func (Ints) Tail

func (s Ints) Tail() (out Ints)

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 (Ints) Tails

func (s Ints) Tails() (out [][]int64)

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 (Ints) Take

func (s Ints) Take(n uint64) (out Ints)

Take takes the first n elements of the slice, or the entire slice if n > len(slice). Can be generated for any type.

func (Ints) TakeWhile

func (s Ints) TakeWhile(p func(int64) bool) (out Ints)

TakeWhile continues appending to the output as long as the predicate is satisfied. Can be generated for any type.

func (Ints) Uncons

func (s Ints) Uncons() (head int64, tail Ints)

Uncons decomposes a slice into the head and tail component. Can be generated for any type.

func (Ints) Unlines

func (s Ints) Unlines() (out string)

Unlines joins together the string representation of the slice with newlines after each element. Can be generated for any type.

func (Ints) Unwords

func (s Ints) Unwords() (out string)

Unwords joins together the string representation of the slice with newlines after each element. Can be generated for any type.

type Strings

type Strings []string

Strings is a wrapper around []string

func Lines

func Lines(s string) Strings

Lines is a wrapper around strings.Split(string, "\n")

func StringReplicate

func StringReplicate(count uint64, value string) (out Strings)

StringReplicate creates a slice with `value` repeated `count` times

func Words

func Words(s string) Strings

Words is a wrapper around strings.Split(string, " ")

func (Strings) All

func (s Strings) All(f func(string) bool) bool

All returns true if all elements of the slice satisfy the predicate. Can be generated for any type.

func (Strings) Any

func (s Strings) Any(f func(string) bool) bool

Any returns true if any of the elements satisfy the predicate. Can be generated for any type.

func (Strings) Break

func (s Strings) Break(f func(string) bool) (before Strings, after Strings)

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 (Strings) Delete

func (s Strings) Delete(e string) (out Strings)

Delete returns a slice with the first matching element removed from the slice. Can be generated for any type.

func (Strings) Drop

func (s Strings) Drop(i int) (out Strings)

Drop returns a new Slice with the elements after the provided key. Can be generated for any type.

func (Strings) DropWhile

func (s Strings) DropWhile(f func(string) bool) (out Strings)

DropWhile returns a new slice containing all elements after the predicate fails for the first time. Can be generated for any type.

func (Strings) Elem

func (s Strings) Elem(el string) bool

Elem returns true if the slice contains the element Can be generated for any type.

func (Strings) Equals

func (is Strings) Equals(other Strings) bool

Equals verifies that both slices contain the same elements, regardless of position.

func (Strings) EqualsOrdered

func (is Strings) EqualsOrdered(other Strings) bool

EqualsOrdered verifies that both slices contain the same elements in the same position.

func (Strings) Filter

func (s Strings) Filter(f func(string) bool) (out Strings)

Filter returns a slice containing only the elements that match the predicate. Can be generated for any type.

func (Strings) Foldl

func (s Strings) Foldl(z string, f func(e1, e2 string) string) (out string)

Foldl reduces a list by iteratively applying f from left->right. Thus, for an empty slice, the result is the default zero-value.

func (Strings) Foldl1

func (s Strings) Foldl1(f func(e1, e2 string) string) (out string)

Foldl1 reduces a list by iteratively applying f from left->right. Thus, for an empty slice, the result is the default zero-value.

func (Strings) Foldr

func (s Strings) Foldr(e string, f func(e1, e2 string) string) (out string)

Foldr reduces a list by iteratively applying f from right -> left. Thus, for an empty slice, the result is the default zero-value.

func (Strings) Foldr1

func (s Strings) Foldr1(f func(e1, e2 string) string) (out string)

Foldr1 reduces a list by iteratively applying f from right -> left. Thus, for an empty slice, the result is the default zero-value.

func (Strings) Group

func (s Strings) Group() (out [][]string)

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 (Strings) Head

func (s Strings) Head() (out string)

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 (Strings) Init

func (s Strings) Init() (out Strings)

Init takes n-1 elements from a slice, where n = len(list). Can be generated for any type.

func (Strings) Inits

func (s Strings) Inits() (out [][]string)

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 (Strings) Intercalate

func (s Strings) Intercalate(ss [][]string) (out Strings)

Intercalate inserts the method receiver slice into the function slice at each step. Can be generated for any type.

func (Strings) Intersperse

func (s Strings) Intersperse(value string) (out Strings)

Intersperse inserts the receiving value between each element of the method receiver. Can be generated for any type.

func (Strings) IsPrefixOf

func (s Strings) IsPrefixOf(in Strings) bool

IsPrefixOf returns true if the current sliceType is a prefix of the passed one. Can be generated for any time.

func (Strings) Last

func (s Strings) Last() (out string)

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 (Strings) Length

func (s Strings) Length() int

Length returns the length (len) of a slice. Can be generated for any type.

func (Strings) Map

func (s Strings) Map(f func(string) string) (out Strings)

Map return a new slice with the map operation applied to each element. Can be generated for any type.

func (Strings) MaximumBy

func (s Strings) MaximumBy(f func(e1, e2 string) string) (max string)

MaximumBy returns the maximum elements according to a custom comparator. Can be generated for any type.

func (Strings) Modes

func (s Strings) Modes() (out Strings)

Modes returns the elements with highest frequency in the slice. Can be generated for any type.

func (Strings) Nub

func (s Strings) Nub() (out Strings)

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 (Strings) Null

func (s Strings) Null() bool

Null returns true the slice is empty. Can be generated for any type.

func (Strings) Reverse

func (s Strings) Reverse() (out Strings)

Reverse returns the reversed slice. Can be generated for any type.

func (Strings) Scanl

func (s Strings) Scanl(e string, f func(e1, e2 string) string) (out Strings)

Scanl reduces a list by iteratively applying f from left->right and then returns each iteration in a slice.

func (Strings) Sort

func (s Strings) Sort() Strings

Sort is a wrapper around go sort function. Can be generated for any type.

func (Strings) Span

func (s Strings) Span(f func(string) bool) (before Strings, after Strings)

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 (Strings) SplitAt

func (s Strings) SplitAt(i int) (before, after Strings)

SplitAt splits the slice at the given index, returning before and after as a tuple. Can be generated for any type.

func (Strings) Sum

func (s Strings) Sum() string

Sum returns the sum of all elements in the slice. Can be generated for any number type.

func (Strings) Tail

func (s Strings) Tail() (out Strings)

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 (Strings) Tails

func (s Strings) Tails() (out [][]string)

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 (Strings) Take

func (s Strings) Take(n uint64) (out Strings)

Take takes the first n elements of the slice, or the entire slice if n > len(slice). Can be generated for any type.

func (Strings) TakeWhile

func (s Strings) TakeWhile(p func(string) bool) (out Strings)

TakeWhile continues appending to the output as long as the predicate is satisfied. Can be generated for any type.

func (Strings) Uncons

func (s Strings) Uncons() (head string, tail Strings)

Uncons decomposes a slice into the head and tail component. Can be generated for any type.

func (Strings) Unlines

func (s Strings) Unlines() (out string)

Unlines joins together the string representation of the slice with newlines after each element. Can be generated for any type.

func (Strings) Unwords

func (s Strings) Unwords() (out string)

Unwords joins together the string representation of the slice with newlines after each element. Can be generated for any type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL