import * as fae from "https://deno.land/x/fae@v1.1.1/mod.ts";
Variables
v _ | Placeholder for curried functions |
v add | Adds two numbers |
Returns a new iteration function from the passed function by adding two more parameters to its callback function
| |
Applies a given function | |
v all | Return |
Takes a list of predicates and returns a predicate that returns true for a given list of arguments if every one of the provided predicates is satisfied by those arguments. | |
Returns a function which that always returns | |
v and | Returns |
Returns the result of applying the onSuccess function to the value inside a successfully resolved promise. This is useful for working with promises inside function compositions. | |
v any | Return |
Takes a list of predicates and returns a predicate that returns true for a given list of arguments if at least one of the provided predicates is satisfied by those arguments. | |
v ap | Iit applies a list of functions to a list of values.
Dispatches to the |
Returns a new list, composed of n-tuples of consecutive elements. If | |
Add the | |
Makes a shallow clone of | |
Makes a shallow clone of an object, setting or overriding the nodes required to create the given path, and placing the specific value at the tail end of that path. Note that this copies and flattens prototype properties onto the new object as well. All non-primitive properties are copied by reference. | |
v both | A function which calls the two provided functions and returns the |
Restricts | |
complement of function(combining) | |
Concat two arrays or strings. Both the arguments passed must be of same type. | |
Returns | |
Creates a new list out of the two supplied by creating each possible pair from the list passed as arguments. | |
Returns the curried function NOTE The passed function will be called as soon as expected number of arguments are received. Rest will be ignored. | |
Returns the second argument if it is not | |
Makes a shallow clone of | |
Makes a shallow clone of an object | |
Divides two numbers. Equivalent to | |
v drop | Returns all but first |
Returns all but last | |
Returns a new list excluding the trailing elements of a | |
Returns a new list without any consecutively repeating elements. Fae.equals is used for comparison | |
Returns a new list without consecutively repeating elements.
Equality is decided by | |
Returns a new list excluding the leading elements of a | |
A function wrapping calls to the two functions in an | |
checks if | |
Reports whether two objects have the same value, for the specified property. Useful as a curried predicate. | |
Filters the those elements from | |
v find | Returns the first element of the list which matches the predicate, or
|
Takes in Array and Element as its 2 parameters Return the 1st index If element is matched or -1 is unmatched. | |
Returns the last element of the list which matches the predicate, or
| |
Returns index of last element of the list which matches the predicate, or
| |
v head | Returns the first element of the given list or string. In some libraries
this function is named |
Returns the position of the first occurrence of | |
Returns a new array with | |
v join | Returns a string made by inserting the |
v lens | Returns a lens for the given getter and setter functions. The |
Returns a lens whose focus is the specified index. | |
Returns a lens whose focus is the specified path. | |
Returns a lens whose focus is the specified property | |
v lift | |
Lifts | |
v map | Applies |
v max | Returns the larger of its two arguments. Fae.max(1, 2) // => 2 Fae.max('abd', 'abc') // => 'abd' Fae.max(1000, NaN) // => NaN |
v mean | Returns the mean of the given list of numbers. |
Returns the median of the given list of numbers. NaNs are filtered out, if present. Returns NaN if the list is empty. | |
v min | Returns the smaller of its two arguments. |
Multiplies two numbers. Equivalent to | |
v not | Returns the not(complement) value of the given value |
v nth | Returns |
v or | Returns |
v over | Returns the result of "setting" the portion of the given data structure |
v path | Retrieve the value at a given path.
The path may be any array of keys or
string of keys separated by |
If the given, non-null object has a value at the given path, returns the value at that path. Otherwise returns the provided default value. | |
Retrieves the values at given paths | |
Returns a new list by plucking the same named property off all objects in the list supplied. | |
Add the | |
v prop | Returns p property |
Returns | |
Returns | |
If the given, non-null object has an own property with the specified name, returns the value of that property. Otherwise returns the provided default value. const fae = { name: 'Fae', age: 15 } const Great = Fae.prop('GreatLibrary') const GreatWithDefault = Fae.propOr('FaeModule', 'GreatLibrary') | |
Returns an array of multiple on the | |
Returns | |
Returns a list of numbers from | |
Returns a list of numbers from | |
Returns a single value by iterating though | |
works as the complement of filter | |
Reverses given string or array without affecting the original. | |
v set | Returns the result of "setting" the portion of the given data structure |
Returns the elements of the given list or string | |
v sort | Returns a copy of the list, sorted according to the comparator function, which should accept two values at a time and return a negative number if the first value is smaller, a positive number if it's larger, and zero if they are equal. |
Subtracts its second argument from its first argument. | |
v tail | Returns all but the first element of |
v take | Returns first |
v tap | Runs the given function |
v trim | Trims the string |
Takes a predicate, a transformation function, and an initial value, and returns a value of the same type as the initial value. | |
Returns a new array with copy of | |
v view | |
v when | Applies |
Takes a specs objects whose properties are predicate functions
Each predicate is applied to the value of the corresponding property of the
test object. Returns | |
Takes a specs objects whose property is a predicate function
Each predicate is applied to the value of the corresponding property of the
test object. Returns | |
Takes a spec object and a test object, returns true if the test satisfies
the spec, false otherwise.
| |
v xor | Exclusive Or - Returns |
v zip | Creates a new list out of two passed lists |
Returns a new object out of given list of | |
Creates a new list out of two passed lists |
Functions
Returns a comparator out of | |
Performs a right-to-left function composition. The last function may have any number of arguments; the remaining must have single argument. Note: The returned function is automatically curried | |
f dec | Decreases its argument by 1. |
Returns the empty value of its argument's type. | |
f flip | Returns a new function much like the supplied one, except that the first two
arguments' order is reversed. The returned function is automatically curried.
But the types are not preserved as of now due to TS limitations. The returned function
will have all unknown in its parameters list and return type. To make it work properly,
you need to use type assertion using |
Creates a new object from a list key-value pairs. If a key appears in multiple pairs, the rightmost pair is included in the object. | |
Returns the supplied parameter | |
f inc | Increases its argument by 1. |
Returns | |
f pipe | Performs a left-to-right function composition. The first function may have any number of arguments; the remaining must have single argument. Note: The returned function is automatically curried. |
f sum | Adds together all the elements of a list. |
Initializes a transducer using supplied iterator function | |
f typ | Gives a single-word string description of the (native) type of a value.
The returned types are of type |
Interfaces
Function type for curried function of arity 1 | |
Function type for curried function of arity 2 | |
Function type for curried function of arity 3 |
Type Aliases
All the types which are returned by function | |
Comparator for functions like | |
T Lens | |
T Pair | |
T Path | |
Type of placeholder for curried functions | |
Predicate function type which checks one value | |
Predicate function type which applies on two values | |
T Prop | |
Type for spec object which contains predicate functions of type {Predicate1} |