predarrays

package
v0.0.0-...-9c50dbb Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package predarrays provides generic slice predicates built with fp-go v2 combinators.

Index

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

func Difference[E any](eq EQ.Eq[E]) func(other []E) func(current []E) []E

Difference returns the set difference of two slices: the elements of current that are not members (per eq) of other.

func Intersect

func Intersect[E any](eq EQ.Eq[E]) func(other []E) func(current []E) []E

Intersect returns the set intersection of two slices: the elements of current that are also members (per eq) of other.

func IsNonEmpty

func IsNonEmpty[E any]() Pred.Predicate[[]E]

IsNonEmpty returns a Predicate[[]E] that is true when len(s) > 0.

func LenEq

func LenEq[E any](n int) Pred.Predicate[[]E]

LenEq returns a Predicate[[]E] that is true when len(s) == n.

func MaxLen

func MaxLen[E any](n int) Pred.Predicate[[]E]

MaxLen returns a Predicate[[]E] that is true when len(s) <= n.

func MemberOf

func MemberOf[E any](eq EQ.Eq[E]) func(value E) Pred.Predicate[[]E]

MemberOf returns a Predicate[[]E] true when value is equal (per eq) to any element of the slice.

func MinLen

func MinLen[E any](n int) Pred.Predicate[[]E]

MinLen returns a Predicate[[]E] that is true when len(s) >= n.

func NotContains

func NotContains[E comparable](value E) Pred.Predicate[[]E]

NotContains returns the negation of Contains.

func NotMemberOf

func NotMemberOf[E any](eq EQ.Eq[E]) func(value E) Pred.Predicate[[]E]

NotMemberOf returns the negation of MemberOf.

Types

This section is empty.

Jump to

Keyboard shortcuts

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