Documentation
¶
Index ¶
- func Add[T Number | string](a, b T) T
- func Asending[T constraints.Integer | constraints.Float](a, b T) int
- func Descending[T constraints.Integer | constraints.Float](a, b T) int
- func Even[T constraints.Integer](x T) bool
- func Multiply[T Number](factor T) func(x T) T
- func Odd[T constraints.Integer](x T) bool
- func StrToInt(s string) (v int)
- func Sum[T Number | string](it Iterator[T]) T
- type Item
- type Iterator
- func C[T any](ch <-chan T) Iterator[T]
- func Chunk[T any](it Iterator[T], size int) Iterator[[]T]
- func Concat[T any](it ...Iterator[T]) Iterator[T]
- func Map[T1, T2 any](it Iterator[T1], mapper func(T1) T2) Iterator[T2]
- func Of[T any](s ...T) Iterator[T]
- func Reverse[T any](it Iterator[T]) Iterator[T]
- func S[S ~[]T, T any](s S) Iterator[T]
- func Sorted[T constraints.Ordered](it Iterator[T]) Iterator[T]
- func SortedFunc[T any](it Iterator[T], less Less[T]) Iterator[T]
- type Less
- type MapIterator
- type Number
- type Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asending ¶
func Asending[T constraints.Integer | constraints.Float](a, b T) int
func Descending ¶
func Descending[T constraints.Integer | constraints.Float](a, b T) int
func Odd ¶
func Odd[T constraints.Integer](x T) bool
Types ¶
type Item ¶
type Item[K comparable, V any] struct { Key K Value V }
type Iterator ¶
type Iterator[T any] interface { Next() (T, bool) Filter(func(T) bool) Iterator[T] Map(func(T) T) Iterator[T] // TODO Map(func(T, T) T) Iterator[T2] go1.19 does not supports yet TakeWhile(func(T) bool) Iterator[T] DropWhile(func(T) bool) Iterator[T] Skip(n int) Iterator[T] Reduce(func(T, T) T) T Slice() []T Each(func(T)) EachIdx(func(int, T)) }
NOTE Next()와 Value()가 thread safe하지 않음..
type MapIterator ¶
type MapIterator[K comparable, V any] interface { Keys() Iterator[K] Values() Iterator[V] Items() Iterator[Item[K, V]] Each(func(K, V)) }
func M ¶
func M[K comparable, V any](m map[K]V) MapIterator[K, V]
type Number ¶
type Number interface {
constraints.Integer | constraints.Float | constraints.Complex
}
Click to show internal directories.
Click to hide internal directories.