User:Theki/functions
Appearance
- nonexistent but should logically exist
- shouldnt logically exist
data
conversions
from to |
boolean | float64 | integer | natural number | rational number | string |
|---|---|---|---|---|---|---|
| boolean | Z10215 | Z15684 | ||||
| float64 | Z20937 | Z20936 | Z20854 | Z20915 | ||
| integer | Z17101 | Z19682 | base n: Z18467 base 10: Z16705 | |||
| natural number | Z17065 | Z20391 | Z13636 | base n: Z13806 base 10: Z14290 | ||
| rational number | Z21071 | Z19744 | Z21653 | Z20112 | Z19866 | |
| string | Z10730 | Z20844 | base n: Z18592 base 10: Z16700 |
base n: Z15671 base 10: Z14280 |
Z19827 | Z11602 |
operations
| float64 | integer | natural number | rational number | string | list | |
|---|---|---|---|---|---|---|
| == | same value: Z20924 same object: Z20850 |
Z16688 | Z13522 | same value: Z19686 same object: Z19892 |
Z866 | Z889 |
| > | Z20943 | Z17132 | Z13676 | Z19751 | ||
| < | Z20940 | Z17140 | Z13689 | Z19753 | ||
| >= | Z20944 | Z17173 | Z13682 | Z19752 | ||
| <= | Z20941 | Z17363 | Z13695 | Z19754 | ||
| + | Z20849 | Z16693 | Z13521 | Z19679 | Z10000 | typed: Z12961 untyped: Z18597 |
| − | Z21031 | Z17111 | as integer: Z17315 as natural number: Z13569 |
Z19699 | first: Z812 last: Z12967 | |
| × | Z21032 | Z17120 | Z13539 | Z19706 | ||
| ÷ | Z21033 | Z17291 | Z13546 | Z19708 | ||
| % | Z22236 | Z17167 | Z13551 | Z20006 | ||
| >> | Z13813 | |||||
| << | Z13812 | |||||
| abs | Z21041 | as integer: Z17128 as natural number: Z17144 | Z21692 | |||
| pow | Z21028 | Z17263 | Z13647 | Z19953 | ||
| sqrt | Z22600 | Z24591 | Z15256 | Z20902 |
boolean operations
| boolean (tf) | kleenean (mtf) | bitwise | |
|---|---|---|---|
| AND | Z10174 | Z22143 | natural number: Z13651 |
| OR | Z10184 | Z22168 | natural number: Z13652 |
| NOT | Z10216 | Z22207 | byte: Z22529 integer: Z17794 |
| NAND | Z10243 | Z24749 | byte: Z24716 |
| XOR (≠) | Z10237 | Z22231 | natural number: Z13653 |
| NOR | Z10231 | ||
| XNOR (=) | Z844 | Z22120 |
list functions
Typed list (Z881): A list containing items of the same type
- generate (range): generate untyped list of length (Z21821): calls the given function for each index 1..=n, appending the results into a list (zero-indexed version at Z24387)
- generate (replicated object): replicate object n times (Z21389): Description missing
- map map function (Z873): return a list of elements processed by a given function
- map(list, const): apply a two-parameter function to a list of first arguments and a common second argument (Z13464): returns a list of the results of running the function once for each item on the list, each time with the first argument from the list and the second argument in common.
- map(const, list): apply a two-parameter function to a common first argument and a list of second arguments (Z13436): returns a list of results
- match tail: rest of list (Z16199): returns the part of the list that follows the first matching element
- type: return Typed list (Z18475): returns a Typed list with the correct Type if all elements have the same Type, otherwise untyped (Z1-typed)
typed?
- concatenate: concatenate Typed lists (Z18755): both lists should be the same type, and the result should have that type
- deduplicate: remove duplicates from Typed list (Z19202): returns a Typed list with duplicate elements removed
- flatten: flatten Typed list (Z23606): flatten a Typed list to limited depth
- generate (natural number range): natural number range (Z13831): Get a list of natural numbers spanning a given range
- reverse: reverse Typed list (Z18479): returns a Typed list with the order of the elements reversed
- untype: untype a list (Z17895): takes a typed list and returns the same objects in an untyped (Z1-typed) list (returns a Z1-typed list unchanged)
map functions
- empty?: is string-keyed map empty (Z24609): Description missing
- from list: make string-keyed map (Z24646): Constructs a typed map out of a list of (string, object) pairs
- get value: get element of string-keyed map (Z24606): returns the second element of the Typed pair whose first element matches the key provided (or the first such pair in the event of duplicate keys)
- identity: Typed map identity (string-keyed) (Z24603): returns the provided typed map unchanged
- map: map function over keys of map (Z24608): runs the provided function on each element of the provided map, with the key in the first argument of the called function and the value in the second argument
- parse JSON: parse JSON object to map (Z24602): Description missing
returns (no map inputs)
language
| A | adjective |
|---|---|
| C | class |
| N | noun |
| V | verb |
Useful:
personal functions
- get keys of JSON object (Z24629)
- get nested keys of JSON object (Z24632)
- index of first Pair w/ identical head element (Z24649)
- display typed pair (Z24660)
- make Typed pair from untyped list (Z24665)
- Mandelbrot set function, complex128 (Z33834)
- Mandelbrot set value (Z33836)
- emphasize string into HTML fragment (Z33890)
- Wikidata statement pair (Z35188)
- apply fn to 2nd element of pair, optional language (Z35190)
- display Wikidata date from statement (Z35192)
- abstract wikilink from statement (Z35199)
- calendar model of Wikidata time (Z35418)
- inject abstract wikilink into monolingual text (Z35472)
date/time
- Arvelie date from Gregorian date (Z23246): year zero defines when journaling begins (e.g. starting timekeeping on 2024-11-30 makes 2024 year zero) (see https://wiki.xxiivv.com/site/arvelie.html)
- Neralie timestamp (Z23783): see https://wiki.xxiivv.com/site/neralie.html
- Unix timestamp from Gregorian calendar date (Z23801): returns provided date as number of seconds since the Unix epoch (1 January 1970); for inverse see Z23808
- Gregorian calendar date from Unix timestamp (Z23808): returns Gregorian calendar date from supplied seconds since the Unix epoch (1 January 1970); for inverse see Z23801
- current date (Z23833): returns the current date, subject to caching (like the magic words 20261006002139 etc.)
- format Unix timestamp (Z23865): format string should be mostly compatible with https://en.cppreference.com/w/cpp/chrono/c/strftime
infoboxes
- infobox for person (Z35370)
- infobox for person as item (Z35167)
- required properties for person infobox (Z35371)
- implementations depend on these bespoke functions
- infobox for person as item (Z35167)
creation
todo
- add toki pona to config for main articles functions (Z33855)
- move certain uses of sentence case (Z10771) to conditional sentence case (Z34096)
- make sure English sentence generation functions have a language parameter to allow for rendering of certain words in e.g. British English (use apply three or optionally four argument function (Z34039))