Documentation ¶
Index ¶
- func Add[T Number](v T) func(T) T
- func C[T any](values ...T) chan T
- func Construct[T any](options ...Option[T]) *T
- func Decrement[T Number]() func(T) T
- func Divide[T Number](v T) func(T) T
- func Eq[T Number](v T) func(T) bool
- func Gt[T Number](v T) func(T) bool
- func Gte[T Number](v T) func(T) bool
- func Increment[T Number]() func(T) T
- func Lt[T Number](v T) func(T) bool
- func Lte[T Number](v T) func(T) bool
- func Map2Struct[T any](data map[string]any, into T) (T, error)
- func Memoize[T any](f func() T) func() T
- func MemoizeWithError[T any](f func() (T, error)) func() (T, error)
- func Mod[T constraints.Integer](v T) func(T) T
- func Multiply[T Number](v T) func(T) T
- func Ne[T Number](v T) func(T) bool
- func Safe[T any](f func(T)) func(T) error
- func Subtract[T Number](v T) func(T) T
- func With[T any](value *T, options ...Option[T])
- func Zero[T any]() T
- type CanError
- type Either
- type LeftOrRight
- type Number
- type Option
- type OptionalValue
- type Pointer
- type Set
- type ValueOrError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MemoizeWithError ¶
func Mod ¶
func Mod[T constraints.Integer](v T) func(T) T
Types ¶
type Either ¶
type Either[L, R any] func() (L, R, LeftOrRight)
type LeftOrRight ¶
type LeftOrRight bool
const ( IsLeft LeftOrRight = false IsRight LeftOrRight = true )
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
type OptionalValue ¶
func Optional ¶
func Optional[T any](value *T) OptionalValue[T]
func OptionalP ¶
func OptionalP[T any](value Pointer[T]) OptionalValue[T]
func (OptionalValue[T]) Do ¶
func (o OptionalValue[T]) Do(with func(*T))
func (OptionalValue[T]) Exists ¶
func (o OptionalValue[T]) Exists() bool
func (OptionalValue[T]) Or ¶
func (o OptionalValue[T]) Or(fill func() *T) OptionalValue[T]
type Set ¶
type Set[T comparable] map[T]struct{}
func (Set[T]) ContainsAll ¶
func (Set[T]) ContainsNone ¶
type ValueOrError ¶
func Try ¶
func Try[T any](f CanError[T]) ValueOrError[T]
func (ValueOrError[T]) OnError ¶
func (v ValueOrError[T]) OnError(f func(error)) ValueOrError[T]
func (ValueOrError[T]) OnSuccess ¶
func (v ValueOrError[T]) OnSuccess(f func(T)) ValueOrError[T]
func (ValueOrError[T]) Return ¶
func (v ValueOrError[T]) Return() (T, error)
Click to show internal directories.
Click to hide internal directories.