Documentation
¶
Overview ¶
Package predarrays provides generic slice predicates built with fp-go v2 combinators.
Index ¶
- func Contains[E comparable](value E) Pred.Predicate[[]E]
- func Difference[E any](eq EQ.Eq[E]) func(other []E) func(current []E) []E
- func Intersect[E any](eq EQ.Eq[E]) func(other []E) func(current []E) []E
- func IsNonEmpty[E any]() Pred.Predicate[[]E]
- func LenEq[E any](n int) Pred.Predicate[[]E]
- func MaxLen[E any](n int) Pred.Predicate[[]E]
- func MemberOf[E any](eq EQ.Eq[E]) func(value E) Pred.Predicate[[]E]
- func MinLen[E any](n int) Pred.Predicate[[]E]
- func NotContains[E comparable](value E) Pred.Predicate[[]E]
- func NotMemberOf[E any](eq EQ.Eq[E]) func(value E) Pred.Predicate[[]E]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[E comparable](value E) Pred.Predicate[[]E]
Contains returns a curried slices.Contains: Contains(value)(slice) → bool.
func Difference ¶
Difference returns the set difference of two slices: the elements of current that are not members (per eq) of other.
func Intersect ¶
Intersect returns the set intersection of two slices: the elements of current that are also members (per eq) of other.
func IsNonEmpty ¶
IsNonEmpty returns a Predicate[[]E] that is true when len(s) > 0.
func MemberOf ¶
MemberOf returns a Predicate[[]E] true when value is equal (per eq) to any element of the slice.
func NotContains ¶
func NotContains[E comparable](value E) Pred.Predicate[[]E]
NotContains returns the negation of Contains.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.