Wikifunctions:Catalogue/Functional operations
Appearance
Note that functions as argument or return types are not fully supported yet. See
Object structure
- ZID of a function (Z28231): Description missing
- get list of argument declarations (Z21177): from a function, get the list of argument declarations (Z8K1)
- number of arguments of a function (Z28222): returns the number of arguments of a function
- types for arguments (Z21172): returns a typed list of the types declared for the given function’s parameters
- type for a function’s first argument (Z28227): returns the Type specified for the first argument to a function
- type for a function’s second argument (Z28243): returns the type for the second argument to a function
- type for a function's third argument (Z29484): returns the type for the third argument to a function
- (!) function return type (Z10112): Returns the return type of a function (Z8K2). The output is currently an Object until T389183 is resolved.
- test cases of function (Z23393): returns the list of test cases (key Z8K3) of a function
- implementations of function (Z23397): returns the list of implementations (key Z8K4) of the function
Test cases
Function application
- map function (Z873): return a list of elements processed by a given function
- apply (Z13036): a function that applies another (single argument) function to a value
- apply two-argument function unless void argument (Z27006): returns the result of applying a two-argument function to the supplied arguments unless either is void, when a void object is returned (or the first object in the fallback list, if that is not empty)
- apply two-argument function if not echo (Z27143): Description missing
- apply unless Throw error (Z28249): If the function is "throw error", throws the specified error; applies 1 argument otherwise
- apply two-argument function (Z13318): a function that applies another (two-argument) function to two arguments
- apply function with 1 or 2 arguments (Z28236): Applies 1 or 2 arguments, in either order, depending on the function's signature. Doesn't work well when an argument is a Typed list.
- apply a two-parameter function to a common first argument and a list of second arguments (Z13436): returns a list of results
- apply a two-parameter function to a list of first arguments and a common second argument (Z13464): returns a list of results
- apply a two-parameter function pairwise to elements of two lists of the same length (Z14779): returns a list of the same length
- apply three-argument function (Z29365): a function that applies another (three-argument) function to three arguments
- apply N-argument function to list of arguments (Z22074): Is this currently possible? https://phabricator.wikimedia.org/T383842
- apply natural number function to positive integer (Z17352): used to pass a positive integer into a function written for natural numbers
- apply integer function to natural number (Z17355): used to pass a natural number into a function written for integers
- apply float64 function to rational number (Z21402): used to pass a rational number into a function written for floating point numbers
- apply list of functions (Z13351): takes a list of functions, a value, and applies the value to the composition of the (single argument) functions (in the order they appear on the list)
- table from function of row and column elements (Z29286): creates a 2d matrix as a list of lists with elements f(ri,cj) where ri is the ith element of the row element list, and cj is the jth element of the column element list
- table from function of set arg and list of row,col (Z29324): creates a 2d matrix as a list of lists with elements f(arg1,[ri,cj]) where arg1 is common, ri is the ith element of the row element list, and cj is the jth element of the column element list. cf Z2936
Comparisons requiring function arguments
- List equality (Z889): lists are exactly the same elements in the same order (whether or not either list is explicitly typed)
- same list (Z18646): returns True if all the elements in two lists are equal and both lists have the same Type
- same list after mapped function (Z23100): returns True if the result of mapping the specified function to each object in the list is the same as the list for comparison (or, more generally, the object by object comparisons are all true)
- compare after applying a single unary function (Z23356): the Boolean result from comparing some object with the result of applying a unary function to some other object (specified first so that it can be the result used in (modified) result validation)
- object comparison (Z23360): compares two objects using the specified comparison function
- compare after applying several unary functions (Z27622): True if the result of applying a sequence of single-argument functions returns True when compared with the given object using the specified comparison function
Others
- string is fixpoint of function (Z12875): check if a string function evaluated at a value has the same value
- K combinator (Z10249): returns a function that returns the given value no matter what value it is passed with
- run unary endofunction n times (Z17958): Description missing
- converge iteratively to fixed point (Z26394): Description missing
Search for
Functions expecting or returning an explicit Function object, singly or in a list
- Strings for function searches (Z22849): returns a list of Wikifunctions search strings for copying into the Search box or a Special:Search link
- String for function signature search (Z22973): returns a String that can be used in a Wikifunctions search for a function, given Type objects for its arguments and return type
- search for similar functions (Z23211): given a function object, returns a string to search for similar functions (with the same return type and argument types in common)
- function searches from Type (Z23072): given a single Type object, returns a list of strings suitable for finding functions using Wikifunctions searches