Predicate that returns a == b. Correctly compares signed and unsigned integers, ie. !(-1 == ~0U).
Predicate that returns a > b. Correctly compares signed and unsigned integers, ie. 2U > -1.
Predicate that returns a < b. Correctly compares signed and unsigned integers, ie. -1 < 2U.
Pipes functions in sequence. Offers the same functionality as compose, but with functions specified in reverse order. This may lead to more readable code in some situation because the order of execution is the same as lexical order.
Takes a function of (potentially) many arguments, and returns a function taking one argument and returns a callable taking the rest. f(x, y) == curry(f)(x)(y)
Convert a callable to a delegate with the same parameter list and return type, avoiding heap allocations and use of auxiliary storage.
Takes multiple functions and adjoins them together.
Transforms a string representing an expression into a binary function. The string must either use symbol names a and b as the parameters or provide the symbols via the parm1Name and parm2Name arguments.
Passes the fields of a struct as arguments to a function.
Composes passed-in functions fun[0], fun[1], ....
Takes a function of (potentially) many arguments, and returns a function taking one argument and returns a callable taking the rest. f(x, y) == curry(f)(x)(y)
Forwards function arguments while keeping out, ref, and lazy on the parameters.
* Memoizes a function so as * to avoid repeated computation. The memoization structure is a hash table keyed by a * tuple of the function's arguments. There is a speed gain if the * function is repeatedly called with the same arguments and is more * expensive than a hash table lookup. For more information on memoization, refer to this book chapter.
Negates predicate pred.
Partially applies fun by tying its first argument to arg.
N-ary predicate that reverses the order of arguments, e.g., given pred(a, b, c), returns pred(c, b, a).
Transforms a string representing an expression into a unary function. The string must either use symbol name a as the parameter or provide the symbol via the parmName argument.
Functions that manipulate other functions.
This module provides functions for compile time function composition. These functions are helpful when constructing predicates for the algorithms in std.algorithm or std.range.