Documentation ¶
Index ¶
- func Fold[T, V any](t Traversable[T], initialValue V, op func(a V, b T) V) V
- func Max[T constraints.Ordered](t *traversable[T]) T
- func Min[T constraints.Ordered](t *traversable[T]) T
- func Product[T number](t *traversable[T]) T
- func Ptr[T any](t T) *T
- func Sum[T number](t *traversable[T]) T
- type KV
- type List
- func (l *List[T]) Add(elements ...T) *List[T]
- func (t *List) Count(filter func(elem T) bool) int
- func (t *List) Exists(filter func(elem T) bool) bool
- func (t *List) Find(filter func(elem T) bool) *Option[T]
- func (t *List) ForAll(filter func(elem T) bool, transform func(elem T) T) *List[T]
- func (l *List[T]) ForEach(action func(T))
- func (t *List) GetOrElse(altValue T) T
- func (t *List) Head() (T, bool)
- func (t *List) HeadOption() *Option[T]
- func (t *List) IsDefined() bool
- func (t *List) IsEmpty() bool
- func (t *List) Last() (T, bool)
- func (t *List) LastOption() *Option[T]
- func (t *List) NonEmpty() bool
- func (t *List) Reduce(op func(a, b T) T) T
- func (t *List) Select(filter func(elem T) bool) *List[T]
- func (t *List) ToList() *List[T]
- type Option
- func (t *Option) Count(filter func(elem T) bool) int
- func (t *Option) Exists(filter func(elem T) bool) bool
- func (t *Option) Find(filter func(elem T) bool) *Option[T]
- func (t *Option) ForAll(filter func(elem T) bool, transform func(elem T) T) *List[T]
- func (o *Option[T]) ForEach(action func(T))
- func (o *Option[T]) GetOrElse(altValue T) T
- func (t *Option) Head() (T, bool)
- func (t *Option) HeadOption() *Option[T]
- func (t *Option) IsDefined() bool
- func (t *Option) IsEmpty() bool
- func (t *Option) Last() (T, bool)
- func (t *Option) LastOption() *Option[T]
- func (t *Option) NonEmpty() bool
- func (t *Option) Reduce(op func(a, b T) T) T
- func (t *Option) Select(filter func(elem T) bool) *List[T]
- func (t *Option) ToList() *List[T]
- type Set
- func (s *Set[T]) Add(elements ...T) *Set[T]
- func (t *Set) Count(filter func(elem T) bool) int
- func (t *Set) Exists(filter func(elem T) bool) bool
- func (t *Set) Find(filter func(elem T) bool) *Option[T]
- func (t *Set) ForAll(filter func(elem T) bool, transform func(elem T) T) *List[T]
- func (s Set[T]) ForEach(action func(T))
- func (t *Set) GetOrElse(altValue T) T
- func (t *Set) Head() (T, bool)
- func (t *Set) HeadOption() *Option[T]
- func (t *Set) IsDefined() bool
- func (t *Set) IsEmpty() bool
- func (t *Set) Last() (T, bool)
- func (t *Set) LastOption() *Option[T]
- func (t *Set) NonEmpty() bool
- func (t *Set) Reduce(op func(a, b T) T) T
- func (t *Set) Select(filter func(elem T) bool) *List[T]
- func (t *Set) ToList() *List[T]
- type Traversable
- type Tuple1
- type Tuple2
- type Tuple3
- type Tuple4
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fold ¶
func Fold[T, V any](t Traversable[T], initialValue V, op func(a V, b T) V) V
func Max ¶
func Max[T constraints.Ordered](t *traversable[T]) T
func Min ¶
func Min[T constraints.Ordered](t *traversable[T]) T
Types ¶
type KV ¶
type KV[K comparable, V any] map[K]V
func EmptyKV ¶
func EmptyKV[K comparable, V any]() KV[K, V]
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
func (*List) HeadOption ¶
func (t *List) HeadOption() *Option[T]
func (*List) LastOption ¶
func (t *List) LastOption() *Option[T]
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func (*Option) HeadOption ¶
func (t *Option) HeadOption() *Option[T]
func (*Option) LastOption ¶
func (t *Option) LastOption() *Option[T]
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func EmptySet ¶
func EmptySet[T comparable]() *Set[T]
func NewSet ¶
func NewSet[T comparable](elements ...T) *Set[T]
func ToSet ¶
func ToSet[T comparable](t *traversable[T]) *Set[T]
func (*Set) HeadOption ¶
func (t *Set) HeadOption() *Option[T]
func (*Set) LastOption ¶
func (t *Set) LastOption() *Option[T]
type Traversable ¶
type Traversable[T any] interface { Head() (T, bool) HeadOption() *Option[T] GetOrElse(altValue T) T Last() (T, bool) LastOption() *Option[T] Find(filter func(elem T) bool) *Option[T] Exists(filter func(elem T) bool) bool Count(filter func(elem T) bool) int Select(filter func(elem T) bool) *List[T] ForAll(filter func(elem T) bool, transform func(elem T) T) *List[T] IsEmpty() bool NonEmpty() bool IsDefined() bool Reduce(op func(a, b T) T) T ToList() *List[T] // contains filtered or unexported methods }
func Map ¶
func Map[T, V any](t Traversable[T], transform func(T) V) Traversable[V]
Click to show internal directories.
Click to hide internal directories.