generic

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append[GA ~[]A, A any](as GA, a A) GA

func Empty

func Empty[GA ~[]A, A any]() GA

func FilterMap

func FilterMap[GA ~[]A, GB ~[]B, A, B any](f func(a A) O.Option[B]) func(GA) GB

func First

func First[GA ~[]A, A any](as GA) O.Option[A]

func From

func From[GA ~[]A, A any](data ...A) GA

From constructs an array from a set of variadic arguments

func Head[GA ~[]A, A any](as GA) O.Option[A]

func Last

func Last[GA ~[]A, A any](as GA) O.Option[A]

func Lookup

func Lookup[GA ~[]A, A any](idx int) func(GA) O.Option[A]

func MonadFilterMap

func MonadFilterMap[GA ~[]A, GB ~[]B, A, B any](fa GA, f func(a A) O.Option[B]) GB

func MonadMap

func MonadMap[GA ~[]A, GB ~[]B, A, B any](as GA, f func(a A) B) GB

func MonadPartition

func MonadPartition[GA ~[]A, A any](as GA, pred func(A) bool) tuple.Tuple2[GA, GA]

func Of

func Of[GA ~[]A, A any](value A) GA

Of constructs a single element array

func Partition

func Partition[GA ~[]A, A any](pred func(A) bool) func(GA) tuple.Tuple2[GA, GA]

func Size

func Size[GA ~[]A, A any](as GA) int

func Sort

func Sort[GA ~[]T, T any](ord O.Ord[T]) func(ma GA) GA

Sort implements a stable sort on the array given the provided ordering

func Tail

func Tail[GA ~[]A, A any](as GA) O.Option[GA]

func UpsertAt

func UpsertAt[GA ~[]A, A any](a A) func(GA) GA

Types

This section is empty.

Jump to

Keyboard shortcuts

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