examples

package
v0.0.0-...-fae6a60 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(haystack []generics.T1, needle generics.T1) bool

Contains returns whether or not the list contains the element

func ContainsString

func ContainsString(haystack []string, needle string) bool

ContainsString returns whether or not the list contains the element

func Diff

func Diff(xs, ys []generics.T1) []generics.T1

Diff finds the difference between two series

func DiffInt

func DiffInt(xs, ys []int) []int

DiffInt finds the difference between two series

func Merge

func Merge(srcs ...<-chan generics.T1) <-chan generics.T1

Merge merges all the src channels into a single channel. If all of the src channels are closed, the returned channel will also be closed.

func MergeInt

func MergeInt(srcs ...<-chan int) <-chan int

MergeInt merges all the src channels into a single channel. If all of the src channels are closed, the returned channel will also be closed.

func Sort

func Sort(xs []generics.T1)

Sort sorts a list

func SortInt8

func SortInt8(xs []int8)

SortInt8 sorts a list

func Sum

func Sum(xs []generics.T1) generics.T1

Sum adds numbers

func SumComplex128

func SumComplex128(xs []complex128) complex128

SumComplex128 adds numbers

func SumComplex64

func SumComplex64(xs []complex64) complex64

SumComplex64 adds numbers

func SumFloat32

func SumFloat32(xs []float32) float32

SumFloat32 adds numbers

func SumFloat64

func SumFloat64(xs []float64) float64

SumFloat64 adds numbers

func SumInt

func SumInt(xs []int) int

SumInt adds numbers

func SumInt16

func SumInt16(xs []int16) int16

SumInt16 adds numbers

func SumInt32

func SumInt32(xs []int32) int32

SumInt32 adds numbers

func SumInt64

func SumInt64(xs []int64) int64

SumInt64 adds numbers

func SumInt8

func SumInt8(xs []int8) int8

SumInt8 adds numbers

func SumUint

func SumUint(xs []uint) uint

SumUint adds numbers

func SumUint16

func SumUint16(xs []uint16) uint16

SumUint16 adds numbers

func SumUint32

func SumUint32(xs []uint32) uint32

SumUint32 adds numbers

func SumUint64

func SumUint64(xs []uint64) uint64

SumUint64 adds numbers

func SumUint8

func SumUint8(xs []uint8) uint8

SumUint8 adds numbers

Types

type List

type List struct {
	// contains filtered or unexported fields
}

A List is a list of elements

func NewList

func NewList() *List

NewList creates a new List

func (*List) Append

func (l *List) Append(els ...generics.T1)

Append appends elements to the list

func (*List) At

func (l *List) At(i int) generics.T1

At returns the element at i

func (List) Len

func (l List) Len() int

Len returns the length of the list

func (*List) Slice

func (l *List) Slice(from, to int) *List

Slice slices the list

type ListFloat32

type ListFloat32 struct {
	// contains filtered or unexported fields
}

func NewListFloat32

func NewListFloat32() *ListFloat32

NewListFloat32 creates a new List

func (*ListFloat32) Append

func (l *ListFloat32) Append(els ...float32)

Append appends elements to the list

func (*ListFloat32) At

func (l *ListFloat32) At(i int) float32

At returns the element at i

func (ListFloat32) Len

func (l ListFloat32) Len() int

Len returns the length of the list

func (*ListFloat32) Slice

func (l *ListFloat32) Slice(from, to int) *ListFloat32

Slice slices the list

type ListInt32

type ListInt32 struct {
	// contains filtered or unexported fields
}

func NewListInt32

func NewListInt32() *ListInt32

NewListInt32 creates a new List

func (*ListInt32) Append

func (l *ListInt32) Append(els ...int32)

Append appends elements to the list

func (*ListInt32) At

func (l *ListInt32) At(i int) int32

At returns the element at i

func (ListInt32) Len

func (l ListInt32) Len() int

Len returns the length of the list

func (*ListInt32) Slice

func (l *ListInt32) Slice(from, to int) *ListInt32

Slice slices the list

type Pair

type Pair struct {
	// Fst is the first value
	Fst generics.T1
	// Snd is the second value
	Snd generics.T2
}

A Pair is a pair of values

func Zip

func Zip(xs []generics.T1, ys []generics.T2) []Pair

Zip takes in two slices and converts them into a slice of pairs

type PairInt8Int16

type PairInt8Int16 struct {
	// Fst is the first value
	Fst int8
	// Snd is the second value
	Snd int16
}

func ZipInt8Int16

func ZipInt8Int16(xs []int8, ys []int16) []PairInt8Int16

ZipInt8Int16 takes in two slices and converts them into a slice of pairs

Jump to

Keyboard shortcuts

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