Documentation ¶
Overview ¶
Package first provides helpers for retrieving a first element of a slice that satisfies a condition
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByPredicate ¶
type ByPredicate[T any] struct { // contains filtered or unexported fields }
ByPredicate is tail prducer of the first.By
func By ¶
func By[T any](by func(T) bool) ByPredicate[T]
By the first part of an expression first.By(tester).Of(elements...)
func (ByPredicate[T]) Of ¶
func (l ByPredicate[T]) Of(elements ...T) (T, bool)
Of the finish part of an expression first.By(tester).Of(elements...)
type OfElements ¶
type OfElements[T any] struct { // contains filtered or unexported fields }
OfElements is tail prducer of the first.Of
func Of ¶
func Of[T any](elements ...T) OfElements[T]
Of the first part of an expression first.Of(elements...).By(tester)
func (OfElements[T]) By ¶
func (l OfElements[T]) By(by func(T) bool) (T, bool)
By the finish part of an expression first.Of(elements...).By(tester)
func (OfElements[T]) Where ¶
func (l OfElements[T]) Where(condition func(T) bool) (T, bool)
Where the finish part of an expression first.Of(elements...).Where(condition)
Click to show internal directories.
Click to hide internal directories.