Documentation ¶
Index ¶
- Variables
- func After[I, O any](fn func(I) O, op func()) func(I) O
- func All[T any](preds ...func(T) bool) func(T) bool
- func And[L, R any](one func(L) bool, two func(R) bool) func(L, R) bool
- func Any[T any](preds ...func(T) bool) func(T) bool
- func AreAll[I any](f func(I) bool) func(...I) bool
- func Assert[T any](arg any) *T
- func Before[I, O any](fn func(I) O, op func()) func(I) O
- func Bind[L, R, T any](f func(L, R) T, val R) func(L) T
- func BindEach[L, R, T any](fn func(L, R) T, vals ...R) []func(L) T
- func BindOp[T, U, V, L, R any](f func(T, func(L, R) U) V, op func(L, R) U) func(T) V
- func BindVar[L, R, T any](f func(L, R) T, v func() R) func(L) T
- func Both[T any](one, two func(T) bool) func(T) bool
- func Capy[T any](dst *[]T, src []T) int
- func Cast[O, I rules.Real](arg I) O
- func Chars[char byte | rune](w string) (out []char)
- func Clone[T any](arg *T) *T
- func CurryL[L, R, T any](f func(L, R) T) func(L) func(R) T
- func CurryLV[L, R, T any](f func(L, ...R) T) func(L) func(...R) T
- func CurryR[L, R, T any](f func(L, R) T) func(R) func(L) T
- func CurryRV[L, R, T any](f func(L, ...R) T) func(...R) func(L) T
- func Denull[T comparable](ptr *T, val T)
- func DenullLener[Seq rules.Lener[K, V], K comparable, V any](ptr *Seq, val Seq)
- func DropLeft[I, L, R any](fn func(I) (L, R)) func(I) R
- func DropRight[I, L, R any](fn func(I) (L, R)) func(I) L
- func Either[T any](one, two func(T) bool) func(T) bool
- func Eq[T comparable](a, b T) bool
- func Flip[L, R, T any](op func(L, R) T) func(R, L) T
- func Fprinter(w io.Writer) func(...any) (int, error)
- func Fprinterf(w io.Writer, format string) func(...any) (int, error)
- func Fprinterln(w io.Writer) func(...any) (int, error)
- func Ge[T rules.Ordered](a, b T) bool
- func Gt[T rules.Ordered](a, b T) bool
- func Imag[N rules.Real, C rules.Complex](arg C) N
- func Integrate[I, O any](f func(I) O) func([]I) []O
- func Is[T comparable](val T) func(T) bool
- func IsEven[T rules.Integer](a T) bool
- func IsFalse(b bool) bool
- func IsFunc[T any](val T, f func(T, T) bool) func(T) bool
- func IsNil[T Niler[*any, any]](arg T) bool
- func IsOdd[T rules.Integer](a T) bool
- func IsTrue(b bool) bool
- func Isnt[T comparable](val T) func(T) bool
- func Le[T rules.Ordered](a, b T) bool
- func Len[T any](arg []T) int
- func Lsb[T rules.Int](arg T) bool
- func Lt[T rules.Ordered](a, b T) bool
- func Method[L, R, T any](val L, f func(L, R) T) func(R) T
- func MethodEach[L, R, T any](fn func(L, R) T, vals ...L) []func(R) T
- func MethodOp[T, U, V, L, R any](op func(L, R) U, f func(func(L, R) U, T) V) func(T) V
- func MethodVar[R, L, T any](v func() L, f func(L, R) T) func(R) T
- func Move[T any](dst, src *[]T) int
- func Msb[T rules.Int](arg T) bool
- func Must[I, O any](f func(I) (O, error)) func(I) O
- func Ne[T comparable](a, b T) bool
- func Neither[T any](one, two func(T) bool) func(T) bool
- func New[T any]() *T
- func Not[T any](pred func(T) bool) func(T) bool
- func NotBoth[T any](one, two func(T) bool) func(T) bool
- func NotNil[T Niler[*any, any]](arg T) bool
- func Nothing(args ...any)
- func One[T any](preds ...func(T) bool) func(T) bool
- func Onead[I, O any](f func(...I) O) func(I) O
- func Or[L, R any](one func(L) bool, two func(R) bool) func(L, R) bool
- func ParseBin[T rules.Real](s string) T
- func ParseFloat[T rules.Real](s string) T
- func ParseHex[T rules.Real](s string) T
- func ParseInt[T rules.Real](s string) T
- func ParseIntn[T rules.Real](n int, s string) T
- func Pipe[L, R, T any](one func(L) R, two func(R) T) func(L) T
- func Pointer[T any](p T) *T
- func Pred[T, U any](pred func(T) bool, whenTrue, whenFalse U) func(T) U
- func Printer() func(...any) (int, error)
- func Printerf(format string) func(...any) (int, error)
- func Printerln() func(...any) (int, error)
- func Real[N rules.Real, C rules.Complex](arg C) N
- func Returner[T any](arg T) T
- func Sizeof[T any]() uintptr
- func Slicead[I, O any](f func(...I) O) func([]I) O
- func Ternary[T any](pred bool, whenTrue, whenFalse T) T
- func ToBool[T comparable](arg T) bool
- func ToBoolLener[Seq rules.Lener[K, V], K comparable, V any](arg Seq) bool
- func ToByte[T rules.Integer](arg T) byte
- func ToComplex128[T rules.Real](arg T) complex128
- func ToComplex64[T rules.Real](arg T) complex64
- func ToFloat32[T rules.Integer](arg T) float32
- func ToFloat64[T rules.Integer](arg T) float64
- func ToInt[T rules.Integer](arg T) int
- func ToInt16[T rules.Integer](arg T) int16
- func ToInt32[T rules.Integer](arg T) int32
- func ToInt64[T rules.Integer](arg T) int64
- func ToInt8[T rules.Integer](arg T) int8
- func ToRune[T rules.Integer](arg T) rune
- func ToString[T any](arg T) string
- func ToString2[T any](arg T) string
- func ToUint[T rules.Integer](arg T) uint
- func ToUint16[T rules.Integer](arg T) uint16
- func ToUint32[T rules.Integer](arg T) uint32
- func ToUint64[T rules.Integer](arg T) uint64
- func ToUint8[T rules.Integer](arg T) uint8
- func ToUintptr[T rules.Integer](arg T) uintptr
- func Typeis[want, have any](arg have) bool
- func Value[T any](p *T) T
- func Variad[I, O any](f func([]I) O) func(...I) O
- func WrapAny[T, L, R any](fn func(L, R)) func(L, R) *T
- func Xor[L, R any](one func(L) bool, two func(R) bool) func(L, R) bool
- type BinOp
- type BinVar
- type Caster
- type Niler
- type Op
- type Option
- type TernOp
- type Var
Constants ¶
This section is empty.
Variables ¶
var DefaultPrinter = os.Stdout
Functions ¶
func All ¶
All AND-concatenates a sequence of boolean operators with of a shared type If no argument is given, the returned predicate will check if its argument's pointer is nil
func Any ¶
Any OR-concatenates a sequence of boolean operators with of a shared type If no argument is given, the returned predicate will check if its argument's pointer is nil
func Assert ¶
Assert uses type assertion to convert a given interface{} into a literal of the given T
func Bind ¶
func Bind[L, R, T any](f func(L, R) T, val R) func(L) T
Bind turns a diadic function of upto two types into a monadic one It is like Method, except it targets the right operand
func BindEach ¶
func BindEach[L, R, T any](fn func(L, R) T, vals ...R) []func(L) T
BindEach creates a collection of unary operators from a binary operator and a collection of operands
func BindOp ¶
func BindOp[T, U, V, L, R any](f func(T, func(L, R) U) V, op func(L, R) U) func(T) V
BindOp turns a diadic function of some type and binary operator into a monadic one It is like MethodOp, except it targets the right operand
func BindVar ¶
func BindVar[L, R, T any](f func(L, R) T, v func() R) func(L) T
BindVar turns a diadic function of upto two types into a monadic one It is like MethodVar, except it targets the right operand
func Capy ¶
Capy copies elements from a source slice into a destination slice with respect to its capacity. The source and destination may overlap. It is a no-op if the destination's length equals its capacity. Returns the number of elements copied, which will be:
0 if src is empty or dst is full cap(dst) - len(dst); unless cap(dst) - len(src) is smaller but non-negative
func Denull ¶
func Denull[T comparable](ptr *T, val T)
Denull sets the value of a pointer if it's current value is zero-like See ToBool
func DenullLener ¶
func DenullLener[Seq rules.Lener[K, V], K comparable, V any](ptr *Seq, val Seq)
DenullLener sets the value of a pointer if it's current value is zero-like See ToBoolLener
func DropLeft ¶
func DropLeft[I, L, R any](fn func(I) (L, R)) func(I) R
DropLeft strips a function of its left-most return value
func DropRight ¶
func DropRight[I, L, R any](fn func(I) (L, R)) func(I) L
DropRight strips a function of its right-most return value
func Flip ¶
func Flip[L, R, T any](op func(L, R) T) func(R, L) T
Flip changes the order of arguments for a binary operator
func Fprinter ¶
Fprinter returns a closure that prints to the given writer defaults to DefaultPrinter if writer is nil
func Fprinterf ¶
Fprinterf returns a closure that prints a format string to the given writer defaults to DefaultPrinter if writer is nil
func Fprinterln ¶
Fprinterln returns a closure that prints a line to the given writer defaults to DefaultPrinter if writer is nil
func Integrate ¶
func Integrate[I, O any](f func(I) O) func([]I) []O
Integrate transforms a function between two types into one between arrays of their instances
func Isnt ¶
func Isnt[T comparable](val T) func(T) bool
Isnt creates an anti-equivalence predicate for a value
func Method ¶
func Method[L, R, T any](val L, f func(L, R) T) func(R) T
Method returns a detatched method for some value calling the given binary operator with it as the left operand similar to Bind except the value is the left operand see Bind for more info
func MethodEach ¶
func MethodEach[L, R, T any](fn func(L, R) T, vals ...L) []func(R) T
MethodEach creates a collection of unary operators from a binary operator and a collection of operands
func MethodOp ¶
func MethodOp[T, U, V, L, R any](op func(L, R) U, f func(func(L, R) U, T) V) func(T) V
MethodOp returns a detatched method for some binary operator calling the given binary operator with it as the left operand similar to BindVal except the value is the left operand see BindOp for more info
func MethodVar ¶
func MethodVar[R, L, T any](v func() L, f func(L, R) T) func(R) T
MethodVar returns a detatched method for some variable calling the given binary operator with it as the left operand similar to BindVal except the value is the left operand see BindVar for more info
func Move ¶
Move moves elements from a source slice into a destination slice with respect to its capacity. The source and destination may overlap. It is a no-op if the destination's length equals its capacity. Returns the number of elements copied, which will be:
0 if src is empty or dst is full cap(dst) - len(dst); unless cap(dst) - len(src) is smaller but non-negative
func Nothing ¶
func Nothing(args ...any)
Nothing is a place holder for imports so that you can run a script even though you've removed all references to an import
func One ¶
Any XOR-concatenates a sequence of boolean operators with of a shared type If no argument is given, the returned predicate will check if its argument's pointer is nil
func Onead ¶
func Onead[I, O any](f func(...I) O) func(I) O
Onead transforms a variadic function to a 1-adic
func ParseBin ¶
ParseBin parses a base 2 integer-string into the given type under the hood, it's a panicky-wrapper on strconv.ParseInt
func ParseFloat ¶
ParseFloat parses a decimal-string into the given type under the hood, it's a panicky-wrapper on strconv.ParseInt
func ParseHex ¶
ParseHex parses a base 16 integer-string into the given type under the hood, it's a panicky-wrapper on strconv.ParseInt
func ParseInt ¶
ParseInt parses a base 10 integer-string into the given type under the hood, it's a panicky-wrapper on strconv.ParseInt
func ParseIntn ¶
ParseIntn parses an integer-string of arbitrary base into the given type under the hood, it's a panicky-wrapper on strconv.ParseInt
func Pipe ¶
func Pipe[L, R, T any](one func(L) R, two func(R) T) func(L) T
Pipe concatenates two unary operators
func Returner ¶
func Returner[T any](arg T) T
Returner is a place holder for pipelines that depend on casters
func Slicead ¶
func Slicead[I, O any](f func(...I) O) func([]I) O
Slicead transforms a variadic function to one that accepts a slice
func ToBool ¶
func ToBool[T comparable](arg T) bool
ToBool returns true iff the argument is non-zero a string is zero iff it's length is zero
func ToBoolLener ¶
func ToBoolLener[Seq rules.Lener[K, V], K comparable, V any](arg Seq) bool
ToBoolIter converts indexable types to booleans if it's length is zero, it is false
func ToComplex128 ¶
func ToComplex128[T rules.Real](arg T) complex128
ToComplex128 casts the argument to a complex128 value
func ToComplex64 ¶
ToComplex64 casts the argument to a complex64 value
Types ¶
type Niler ¶
type Niler[K comparable, V any] interface { ~*V | ~[]V | ~map[K]V | ~chan V //| error // compiler: cannot use error in union (error contains methods) }
Niler is a constraint satisfied by nullable types