Skip to content

Instantly share code, notes, and snippets.

@haakenlid
Last active September 6, 2017 23:25
Show Gist options
  • Save haakenlid/1438e1c736bc44d360374fd843d1be4d to your computer and use it in GitHub Desktop.
Save haakenlid/1438e1c736bc44d360374fd843d1be4d to your computer and use it in GitHub Desktop.
ramda typedefs
import requests, re, json
url = 'https://raw.githubusercontent.com/ramda/ramda/master/dist/ramda.js'
code = requests.get(url).text
def parse_jsdoc(doc='', name=''):
doc = re.sub(r'^\s*\*[ \/]?', '', doc, flags=re.M)
sig = re.search(r'@sig (.+)', doc)
if sig:
sig = sig.groups()[0]
private = bool(re.search(r'@private', doc))
doc = doc.split('\n\n')[0].replace('\n', ' ')
return (name, doc, sig, private)
pattern = re.compile(
r'/\*\*(?P<doc>.*?)^\s*var (?P<name>\w+) =',
flags=re.DOTALL | re.MULTILINE
)
defs = { "!name": "ramda", "R": {} }
matches = [m.groupdict() for m in pattern.finditer(text)]
for m in matches[:]:
name, doc, sig, private = parse_jsdoc(**m)
if not private:
defs['R'][name] = {
'!type': sig,
'!doc': doc,
'!url': 'http://ramdajs.com/docs/#' + name,
}
with open('ramda.json', 'w') as fp:
json.dump(defs, fp, indent=2)
{
"!name": "ramda",
"R": {
"transpose": {
"!url": "http://ramdajs.com/docs/#transpose",
"!type": "[[a]] -> [[a]]",
"!doc": "Transposes the rows and columns of a 2D list. When passed a list of `n` lists of length `x`, returns a list of `x` lists of length `n`."
},
"reverse": {
"!url": "http://ramdajs.com/docs/#reverse",
"!type": "[a] -> [a]",
"!doc": "Returns a new list or string with the elements or characters in reverse order."
},
"replace": {
"!url": "http://ramdajs.com/docs/#replace",
"!type": "RegExp|String -> String -> String -> String",
"!doc": "Replace a substring or regex match in a string with a replacement."
},
"innerJoin": {
"!url": "http://ramdajs.com/docs/#innerJoin",
"!type": "(a -> b -> Boolean) -> [a] -> [b] -> [a]",
"!doc": "Takes a predicate `pred`, a list `xs`, and a list `ys`, and returns a list `xs'` comprising each of the elements of `xs` which is equal to one or more elements of `ys` according to `pred`."
},
"pluck": {
"!url": "http://ramdajs.com/docs/#pluck",
"!type": "Functor f => k -> f {k: v} -> f v",
"!doc": "Returns a new list by plucking the same named property off all objects in the list supplied."
},
"negate": {
"!url": "http://ramdajs.com/docs/#negate",
"!type": "Number -> Number",
"!doc": "Negates its argument."
},
"endsWith": {
"!url": "http://ramdajs.com/docs/#endsWith",
"!type": "[a] -> Boolean",
"!doc": "Checks if a list ends with the provided values"
},
"pick": {
"!url": "http://ramdajs.com/docs/#pick",
"!type": "[k] -> {k: v} -> {k: v}",
"!doc": "Returns a partial copy of an object containing only the keys specified. If the key does not exist, the property is ignored."
},
"dropRepeatsWith": {
"!url": "http://ramdajs.com/docs/#dropRepeatsWith",
"!type": "(a, a -> Boolean) -> [a] -> [a]",
"!doc": "Returns a new list without any consecutively repeating elements. Equality is determined by applying the supplied predicate to each pair of consecutive elements. The first element in a series of equal elements will be preserved."
},
"F": {
"!url": "http://ramdajs.com/docs/#F",
"!type": "* -> Boolean",
"!doc": "A function that always returns `false`. Any passed in parameters are ignored."
},
"length": {
"!url": "http://ramdajs.com/docs/#length",
"!type": "[a] -> Number",
"!doc": "Returns the number of elements in the array by returning `list.length`."
},
"countBy": {
"!url": "http://ramdajs.com/docs/#countBy",
"!type": "(a -> String) -> [a] -> {*}",
"!doc": "Counts the elements of a list according to how many match each value of a key generated by the supplied function. Returns an object mapping the keys produced by `fn` to the number of occurrences in the list. Note that all keys are coerced to strings because of how JavaScript objects work."
},
"mathMod": {
"!url": "http://ramdajs.com/docs/#mathMod",
"!type": "Number -> Number -> Number",
"!doc": "`mathMod` behaves like the modulo operator should mathematically, unlike the `%` operator (and by extension, [`R.modulo`](#modulo)). So while `-17 % 5` is `-2`, `mathMod(-17, 5)` is `3`. `mathMod` requires Integer arguments, and returns NaN when the modulus is zero or negative."
},
"groupWith": {
"!url": "http://ramdajs.com/docs/#groupWith",
"!type": "((a, a) \u2192 Boolean) \u2192 [a] \u2192 [[a]]",
"!doc": "Takes a list and returns a list of lists where each sublist's elements are all satisfied pairwise comparison according to the provided function. Only adjacent elements are passed to the comparison function."
},
"view": {
"!url": "http://ramdajs.com/docs/#view",
"!type": "Lens s a -> s -> a",
"!doc": "Returns a \"view\" of the given data structure, determined by the given lens. The lens's focus determines which portion of the data structure is visible."
},
"add": {
"!url": "http://ramdajs.com/docs/#add",
"!type": "Number -> Number -> Number",
"!doc": "Adds two values."
},
"splitAt": {
"!url": "http://ramdajs.com/docs/#splitAt",
"!type": "Number -> [a] -> [[a], [a]]",
"!doc": "Splits a given list or string at a given index."
},
"apply": {
"!url": "http://ramdajs.com/docs/#apply",
"!type": "(*... -> a) -> [*] -> a",
"!doc": "Applies function `fn` to the argument list `args`. This is useful for creating a fixed-arity function from a variadic function. `fn` should be a bound function if context is significant."
},
"whereEq": {
"!url": "http://ramdajs.com/docs/#whereEq",
"!type": "{String: *} -> {String: *} -> Boolean",
"!doc": "Takes a spec object and a test object; returns true if the test satisfies the spec, false otherwise. An object satisfies the spec if, for each of the spec's own properties, accessing that property of the object gives the same value (in [`R.equals`](#equals) terms) as accessing that property of the spec."
},
"empty": {
"!url": "http://ramdajs.com/docs/#empty",
"!type": "a -> a",
"!doc": "Returns the empty value of its argument's type. Ramda defines the empty value of Array (`[]`), Object (`{}`), String (`''`), and Arguments. Other types are supported if they define `<Type>.empty` and/or `<Type>.prototype.empty`."
},
"unapply": {
"!url": "http://ramdajs.com/docs/#unapply",
"!type": "([*...] -> a) -> (*... -> a)",
"!doc": "Takes a function `fn`, which takes a single array argument, and returns a function which:"
},
"_toISOString": {
"!url": "http://ramdajs.com/docs/#_toISOString",
"!type": null,
"!doc": "Polyfill from <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString>."
},
"toUpper": {
"!url": "http://ramdajs.com/docs/#toUpper",
"!type": "String -> String",
"!doc": "The upper case version of a string."
},
"descend": {
"!url": "http://ramdajs.com/docs/#descend",
"!type": "Ord b => (a -> b) -> a -> a -> Number",
"!doc": "Makes a descending comparator function out of a function that returns a value that can be compared with `<` and `>`."
},
"transduce": {
"!url": "http://ramdajs.com/docs/#transduce",
"!type": "(c -> c) -> ((a, b) -> a) -> a -> [b] -> a",
"!doc": "Initializes a transducer using supplied iterator function. Returns a single item by iterating through the list, successively calling the transformed iterator function and passing it an accumulator value and the current value from the array, and then passing the result to the next call."
},
"propOr": {
"!url": "http://ramdajs.com/docs/#propOr",
"!type": "a -> String -> Object -> a",
"!doc": "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."
},
"uniqBy": {
"!url": "http://ramdajs.com/docs/#uniqBy",
"!type": "(a -> b) -> [a] -> [a]",
"!doc": "Returns a new list containing only one copy of each element in the original list, based upon the value returned by applying the supplied function to each list element. Prefers the first item if the supplied function produces the same value on two items. [`R.equals`](#equals) is used for comparison."
},
"sortBy": {
"!url": "http://ramdajs.com/docs/#sortBy",
"!type": "Ord b => (a -> b) -> [a] -> [a]",
"!doc": "Sorts the list according to the supplied function."
},
"differenceWith": {
"!url": "http://ramdajs.com/docs/#differenceWith",
"!type": "((a, a) -> Boolean) -> [a] -> [a] -> [a]",
"!doc": "Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list. Duplication is determined according to the value returned by applying the supplied predicate to two list elements."
},
"all": {
"!url": "http://ramdajs.com/docs/#all",
"!type": "(a -> Boolean) -> [a] -> Boolean",
"!doc": "Returns `true` if all elements of the list match the predicate, `false` if there are any that don't."
},
"construct": {
"!url": "http://ramdajs.com/docs/#construct",
"!type": "(* -> {*}) -> (* -> {*})",
"!doc": "Wraps a constructor function inside a curried function that can be called with the same arguments and returns the same type."
},
"hasIn": {
"!url": "http://ramdajs.com/docs/#hasIn",
"!type": "s -> {s: x} -> Boolean",
"!doc": "Returns whether or not an object or its prototype chain has a property with the specified name"
},
"ifElse": {
"!url": "http://ramdajs.com/docs/#ifElse",
"!type": "(*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)",
"!doc": "Creates a function that will process either the `onTrue` or the `onFalse` function depending upon the result of the `condition` predicate."
},
"aperture": {
"!url": "http://ramdajs.com/docs/#aperture",
"!type": "Number -> [a] -> [[a]]",
"!doc": "Returns a new list, composed of n-tuples of consecutive elements. If `n` is greater than the length of the list, an empty list is returned."
},
"symmetricDifferenceWith": {
"!url": "http://ramdajs.com/docs/#symmetricDifferenceWith",
"!type": "((a, a) -> Boolean) -> [a] -> [a] -> [a]",
"!doc": "Finds the set (i.e. no duplicates) of all elements contained in the first or second list, but not both. Duplication is determined according to the value returned by applying the supplied predicate to two list elements."
},
"addIndex": {
"!url": "http://ramdajs.com/docs/#addIndex",
"!type": "((a ... -> b) ... -> [a] -> *) -> (a ..., Int, [a] -> b) ... -> [a] -> *)",
"!doc": "Creates a new list iteration function from an existing one by adding two new parameters to its callback function: the current index, and the entire list."
},
"concat": {
"!url": "http://ramdajs.com/docs/#concat",
"!type": "[a] -> [a] -> [a]",
"!doc": "Returns the result of concatenating the given lists or strings."
},
"of": {
"!url": "http://ramdajs.com/docs/#of",
"!type": "a -> [a]",
"!doc": "Returns a singleton array containing the value provided."
},
"assocPath": {
"!url": "http://ramdajs.com/docs/#assocPath",
"!type": "[Idx] -> a -> {a} -> {a}",
"!doc": "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."
},
"zip": {
"!url": "http://ramdajs.com/docs/#zip",
"!type": "[a] -> [b] -> [[a,b]]",
"!doc": "Creates a new list out of the two supplied by pairing up equally-positioned items from both lists. The returned list is truncated to the length of the shorter of the two input lists. Note: `zip` is equivalent to `zipWith(function(a, b) { return [a, b] })`."
},
"lt": {
"!url": "http://ramdajs.com/docs/#lt",
"!type": "Ord a => a -> a -> Boolean",
"!doc": "Returns `true` if the first argument is less than the second; `false` otherwise."
},
"lte": {
"!url": "http://ramdajs.com/docs/#lte",
"!type": "Ord a => a -> a -> Boolean",
"!doc": "Returns `true` if the first argument is less than or equal to the second; `false` otherwise."
},
"take": {
"!url": "http://ramdajs.com/docs/#take",
"!type": "Number -> [a] -> [a]",
"!doc": "Returns the first `n` elements of the given list, string, or transducer/transformer (or object with a `take` method)."
},
"not": {
"!url": "http://ramdajs.com/docs/#not",
"!type": "* -> Boolean",
"!doc": "A function that returns the `!` of its argument. It will return `true` when passed false-y value, and `false` when passed a truth-y one."
},
"drop": {
"!url": "http://ramdajs.com/docs/#drop",
"!type": "Number -> [a] -> [a]",
"!doc": "Returns all but the first `n` elements of the given list, string, or transducer/transformer (or object with a `drop` method)."
},
"lift": {
"!url": "http://ramdajs.com/docs/#lift",
"!type": "(*... -> *) -> ([*]... -> [*])",
"!doc": "\"lifts\" a function of arity > 1 so that it may \"map over\" a list, Function or other object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply)."
},
"identical": {
"!url": "http://ramdajs.com/docs/#identical",
"!type": "a -> a -> Boolean",
"!doc": "Returns true if its arguments are identical, false otherwise. Values are identical if they reference the same memory. `NaN` is identical to `NaN`; `0` and `-0` are not identical."
},
"sortWith": {
"!url": "http://ramdajs.com/docs/#sortWith",
"!type": "[a -> a -> Number] -> [a] -> [a]",
"!doc": "Sorts a list according to a list of comparators."
},
"init": {
"!url": "http://ramdajs.com/docs/#init",
"!type": "[a] -> [a]",
"!doc": "Returns all but the last element of the given list or string."
},
"liftN": {
"!url": "http://ramdajs.com/docs/#liftN",
"!type": "Number -> (*... -> *) -> ([*]... -> [*])",
"!doc": "\"lifts\" a function to be the specified arity, so that it may \"map over\" that many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply)."
},
"ascend": {
"!url": "http://ramdajs.com/docs/#ascend",
"!type": "Ord b => (a -> b) -> a -> a -> Number",
"!doc": "Makes an ascending comparator function out of a function that returns a value that can be compared with `<` and `>`."
},
"zipWith": {
"!url": "http://ramdajs.com/docs/#zipWith",
"!type": "(a,b -> c) -> [a] -> [b] -> [c]",
"!doc": "Creates a new list out of the two supplied by applying the function to each equally-positioned pair in the lists. The returned list is truncated to the length of the shorter of the two input lists."
},
"eqProps": {
"!url": "http://ramdajs.com/docs/#eqProps",
"!type": "k -> {k: v} -> {k: v} -> Boolean",
"!doc": "Reports whether two objects have the same value, in [`R.equals`](#equals) terms, for the specified property. Useful as a curried predicate."
},
"insertAll": {
"!url": "http://ramdajs.com/docs/#insertAll",
"!type": "Number -> [a] -> [a] -> [a]",
"!doc": "Inserts the sub-list into the list, at the specified `index`. _Note that this is not destructive_: it returns a copy of the list with the changes. <small>No lists have been harmed in the application of this function.</small>"
},
"mergeAll": {
"!url": "http://ramdajs.com/docs/#mergeAll",
"!type": "[{k: v}] -> {k: v}",
"!doc": "Merges a list of objects together into one object."
},
"append": {
"!url": "http://ramdajs.com/docs/#append",
"!type": "a -> [a] -> [a]",
"!doc": "Returns a new list containing the contents of the given list, followed by the given element."
},
"splitWhen": {
"!url": "http://ramdajs.com/docs/#splitWhen",
"!type": "(a -> Boolean) -> [a] -> [[a], [a]]",
"!doc": "Takes a list and a predicate and returns a pair of lists with the following properties:"
},
"type": {
"!url": "http://ramdajs.com/docs/#type",
"!type": "(* -> {*}) -> String",
"!doc": "Gives a single-word string description of the (native) type of a value, returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not attempt to distinguish user Object types any further, reporting them all as 'Object'."
},
"chain": {
"!url": "http://ramdajs.com/docs/#chain",
"!type": "Chain m => (a -> m b) -> m a -> m b",
"!doc": "`chain` maps a function over a list and concatenates the results. `chain` is also known as `flatMap` in some libraries"
},
"zipObj": {
"!url": "http://ramdajs.com/docs/#zipObj",
"!type": "[String] -> [*] -> {String: *}",
"!doc": "Creates a new object out of a list of keys and a list of values. Key/value pairing is truncated to the length of the shorter of the two lists. Note: `zipObj` is equivalent to `pipe(zipWith(pair), fromPairs)`."
},
"scan": {
"!url": "http://ramdajs.com/docs/#scan",
"!type": "(a,b -> a) -> a -> [b] -> [a]",
"!doc": "Scan is similar to [`reduce`](#reduce), but returns a list of successively reduced values from the left"
},
"reject": {
"!url": "http://ramdajs.com/docs/#reject",
"!type": "Filterable f => (a -> Boolean) -> f a -> f a",
"!doc": "The complement of [`filter`](#filter)."
},
"match": {
"!url": "http://ramdajs.com/docs/#match",
"!type": "RegExp -> String -> [String | Undefined]",
"!doc": "Tests a regular expression against a String. Note that this function will return an empty array when there are no matches. This differs from [`String.prototype.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) which returns `null` when there are no matches."
},
"mergeWith": {
"!url": "http://ramdajs.com/docs/#mergeWith",
"!type": "(a -> a -> a) -> {a} -> {a} -> {a}",
"!doc": "Creates a new object with the own properties of the two provided objects. If a key exists in both objects, the provided function is applied to the values associated with the key in each object, with the result being used as the value associated with the key in the returned object."
},
"startsWith": {
"!url": "http://ramdajs.com/docs/#startsWith",
"!type": "[a] -> Boolean",
"!doc": "Checks if a list starts with the provided values"
},
"mergeDeepWithKey": {
"!url": "http://ramdajs.com/docs/#mergeDeepWithKey",
"!type": "(String -> a -> a -> a) -> {a} -> {a} -> {a}",
"!doc": "Creates a new object with the own properties of the two provided objects. If a key exists in both objects: - and both associated values are also objects then the values will be recursively merged. - otherwise the provided function is applied to the key and associated values using the resulting value as the new value associated with the key. If a key only exists in one object, the value will be associated with the key of the resulting object."
},
"or": {
"!url": "http://ramdajs.com/docs/#or",
"!type": "a -> b -> a | b",
"!doc": "Returns `true` if one or both of its arguments are `true`. Returns `false` if both arguments are `false`."
},
"gte": {
"!url": "http://ramdajs.com/docs/#gte",
"!type": "Ord a => a -> a -> Boolean",
"!doc": "Returns `true` if the first argument is greater than or equal to the second; `false` otherwise."
},
"curryN": {
"!url": "http://ramdajs.com/docs/#curryN",
"!type": "Number -> (* -> a) -> (* -> a)",
"!doc": "Returns a curried equivalent of the provided function, with the specified arity. The curried function has two unusual capabilities. First, its arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the following are equivalent:"
},
"partition": {
"!url": "http://ramdajs.com/docs/#partition",
"!type": "Filterable f => (a -> Boolean) -> f a -> [f a, f a]",
"!doc": "Takes a predicate and a list or other `Filterable` object and returns the pair of filterable objects of the same type of elements which do and do not satisfy, the predicate, respectively. Filterable objects include plain objects or any object that has a filter method such as `Array`."
},
"max": {
"!url": "http://ramdajs.com/docs/#max",
"!type": "Ord a => a -> a -> a",
"!doc": "Returns the larger of its two arguments."
},
"fromPairs": {
"!url": "http://ramdajs.com/docs/#fromPairs",
"!type": "[[k,v]] -> {k: v}",
"!doc": "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."
},
"unless": {
"!url": "http://ramdajs.com/docs/#unless",
"!type": "(a -> Boolean) -> (a -> a) -> a -> a",
"!doc": "Tests the final argument by passing it to the given predicate function. If the predicate is not satisfied, the function will return the result of calling the `whenFalseFn` function with the same argument. If the predicate is satisfied, the argument is returned as is."
},
"nth": {
"!url": "http://ramdajs.com/docs/#nth",
"!type": "Number -> [a] -> a | Undefined",
"!doc": "Returns the nth element of the given list or string. If n is negative the element at index length + n is returned."
},
"test": {
"!url": "http://ramdajs.com/docs/#test",
"!type": "RegExp -> String -> Boolean",
"!doc": "Determines whether a given string matches a given regular expression."
},
"project": {
"!url": "http://ramdajs.com/docs/#project",
"!type": "[k] -> [{k: v}] -> [{k: v}]",
"!doc": "Reasonable analog to SQL `select` statement."
},
"invoker": {
"!url": "http://ramdajs.com/docs/#invoker",
"!type": "Number -> String -> (a -> b -> ... -> n -> Object -> *)",
"!doc": "Turns a named method with a specified arity into a function that can be called directly supplied with arguments and a target object."
},
"memoize": {
"!url": "http://ramdajs.com/docs/#memoize",
"!type": "(*... -> a) -> (*... -> a)",
"!doc": "Creates a new function that, when invoked, caches the result of calling `fn` for a given argument set and returns the result. Subsequent calls to the memoized `fn` with the same argument set will not result in an additional call to `fn`; instead, the cached result for that set of arguments will be returned."
},
"until": {
"!url": "http://ramdajs.com/docs/#until",
"!type": "(a -> Boolean) -> (a -> a) -> a -> a",
"!doc": "Takes a predicate, a transformation function, and an initial value, and returns a value of the same type as the initial value. It does so by applying the transformation until the predicate is satisfied, at which point it returns the satisfactory value."
},
"ap": {
"!url": "http://ramdajs.com/docs/#ap",
"!type": "[a -> b] -> [a] -> [b]",
"!doc": "ap applies a list of functions to a list of values."
},
"cond": {
"!url": "http://ramdajs.com/docs/#cond",
"!type": "[[(*... -> Boolean),(*... -> *)]] -> (*... -> *)",
"!doc": "Returns a function, `fn`, which encapsulates `if/else, if/else, ...` logic. `R.cond` takes a list of [predicate, transformer] pairs. All of the arguments to `fn` are applied to each of the predicates in turn until one returns a \"truthy\" value, at which point `fn` returns the result of applying its arguments to the corresponding transformer. If none of the predicates matches, `fn` returns undefined."
},
"lastIndexOf": {
"!url": "http://ramdajs.com/docs/#lastIndexOf",
"!type": "a -> [a] -> Number",
"!doc": "Returns the position of the last occurrence of an item in an array, or -1 if the item is not included in the array. [`R.equals`](#equals) is used to determine equality."
},
"sort": {
"!url": "http://ramdajs.com/docs/#sort",
"!type": "(a,a -> Number) -> [a] -> [a]",
"!doc": "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. Please note that this is a **copy** of the list. It does not modify the original."
},
"mergeWithKey": {
"!url": "http://ramdajs.com/docs/#mergeWithKey",
"!type": "(String -> a -> a -> a) -> {a} -> {a} -> {a}",
"!doc": "Creates a new object with the own properties of the two provided objects. If a key exists in both objects, the provided function is applied to the key and the values associated with the key in each object, with the result being used as the value associated with the key in the returned object."
},
"objOf": {
"!url": "http://ramdajs.com/docs/#objOf",
"!type": "String -> a -> {String:a}",
"!doc": "Creates an object containing a single key:value pair."
},
"trim": {
"!url": "http://ramdajs.com/docs/#trim",
"!type": "String -> String",
"!doc": "Removes (strips) whitespace from both ends of the string."
},
"pathSatisfies": {
"!url": "http://ramdajs.com/docs/#pathSatisfies",
"!type": "(a -> Boolean) -> [Idx] -> {a} -> Boolean",
"!doc": "Returns `true` if the specified object property at given path satisfies the given predicate; `false` otherwise."
},
"dropRepeats": {
"!url": "http://ramdajs.com/docs/#dropRepeats",
"!type": "[a] -> [a]",
"!doc": "Returns a new list without any consecutively repeating elements. [`R.equals`](#equals) is used to determine equality."
},
"range": {
"!url": "http://ramdajs.com/docs/#range",
"!type": "Number -> Number -> [Number]",
"!doc": "Returns a list of numbers from `from` (inclusive) to `to` (exclusive)."
},
"prepend": {
"!url": "http://ramdajs.com/docs/#prepend",
"!type": "a -> [a] -> [a]",
"!doc": "Returns a new list with the given element at the front, followed by the contents of the list."
},
"either": {
"!url": "http://ramdajs.com/docs/#either",
"!type": "(*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)",
"!doc": "A function wrapping calls to the two functions in an `||` operation, returning the result of the first function if it is truth-y and the result of the second function otherwise. Note that this is short-circuited, meaning that the second function will not be invoked if the first returns a truth-y value."
},
"both": {
"!url": "http://ramdajs.com/docs/#both",
"!type": "(*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)",
"!doc": "A function which calls the two provided functions and returns the `&&` of the results. It returns the result of the first function if it is false-y and the result of the second function otherwise. Note that this is short-circuited, meaning that the second function will not be invoked if the first returns a false-y value."
},
"dec": {
"!url": "http://ramdajs.com/docs/#dec",
"!type": "Number -> Number",
"!doc": "Decrements its argument."
},
"minBy": {
"!url": "http://ramdajs.com/docs/#minBy",
"!type": "Ord b => (a -> b) -> a -> a -> a",
"!doc": "Takes a function and two values, and returns whichever value produces the smaller result when passed to the provided function."
},
"flip": {
"!url": "http://ramdajs.com/docs/#flip",
"!type": "(a -> b -> c -> ... -> z) -> (b -> a -> c -> ... -> z)",
"!doc": "Returns a new function much like the supplied one, except that the first two arguments' order is reversed."
},
"allPass": {
"!url": "http://ramdajs.com/docs/#allPass",
"!type": "[(*... -> Boolean)] -> (*... -> Boolean)",
"!doc": "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."
},
"mean": {
"!url": "http://ramdajs.com/docs/#mean",
"!type": "[Number] -> Number",
"!doc": "Returns the mean of the given list of numbers."
},
"memoizeWith": {
"!url": "http://ramdajs.com/docs/#memoizeWith",
"!type": "(*... -> String) -> (*... -> a) -> (*... -> a)",
"!doc": "A customisable version of [`R.memoize`](#memoize). `memoizeWith` takes an additional function that will be applied to a given argument set and used to create the cache key under which the results of the function to be memoized will be stored. Care must be taken when implementing key generation to avoid clashes that may overwrite previous entries erroneously."
},
"sequence": {
"!url": "http://ramdajs.com/docs/#sequence",
"!type": "(Applicative f, Traversable t) => (a -> f a) -> t (f a) -> f (t a)",
"!doc": "Transforms a [Traversable](https://github.com/fantasyland/fantasy-land#traversable) of [Applicative](https://github.com/fantasyland/fantasy-land#applicative) into an Applicative of Traversable."
},
"toPairs": {
"!url": "http://ramdajs.com/docs/#toPairs",
"!type": "{String: *} -> [[String,*]]",
"!doc": "Converts an object into an array of key, value arrays. Only the object's own properties are used. Note that the order of the output array is not guaranteed to be consistent across different JS platforms."
},
"sum": {
"!url": "http://ramdajs.com/docs/#sum",
"!type": "[Number] -> Number",
"!doc": "Adds together all the elements of a list."
},
"reduceRight": {
"!url": "http://ramdajs.com/docs/#reduceRight",
"!type": "(a, b -> b) -> b -> [a] -> b",
"!doc": "Returns a single item by iterating through the list, successively calling the iterator function and passing it an accumulator value and the current value from the array, and then passing the result to the next call."
},
"valuesIn": {
"!url": "http://ramdajs.com/docs/#valuesIn",
"!type": "{k: v} -> [v]",
"!doc": "Returns a list of all the properties, including prototype properties, of the supplied object. Note that the order of the output array is not guaranteed to be consistent across different JS platforms."
},
"toLower": {
"!url": "http://ramdajs.com/docs/#toLower",
"!type": "String -> String",
"!doc": "The lower case version of a string."
},
"nAry": {
"!url": "http://ramdajs.com/docs/#nAry",
"!type": "Number -> (* -> a) -> (* -> a)",
"!doc": "Wraps a function of any arity (including nullary) in a function that accepts exactly `n` parameters. Any extraneous parameters will not be passed to the supplied function."
},
"inc": {
"!url": "http://ramdajs.com/docs/#inc",
"!type": "Number -> Number",
"!doc": "Increments its argument."
},
"toPairsIn": {
"!url": "http://ramdajs.com/docs/#toPairsIn",
"!type": "{String: *} -> [[String,*]]",
"!doc": "Converts an object into an array of key, value arrays. The object's own properties and prototype properties are used. Note that the order of the output array is not guaranteed to be consistent across different JS platforms."
},
"equals": {
"!url": "http://ramdajs.com/docs/#equals",
"!type": "a -> b -> Boolean",
"!doc": "Returns `true` if its arguments are equivalent, `false` otherwise. Handles cyclical data structures."
},
"comparator": {
"!url": "http://ramdajs.com/docs/#comparator",
"!type": "(a, b -> Boolean) -> (a, b -> Number)",
"!doc": "Makes a comparator function out of a function that reports whether the first element is less than the second."
},
"mapAccumRight": {
"!url": "http://ramdajs.com/docs/#mapAccumRight",
"!type": "(x-> acc -> (y, acc)) -> acc -> [x] -> ([y], acc)",
"!doc": "The `mapAccumRight` function behaves like a combination of map and reduce; it applies a function to each element of a list, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new list."
},
"invert": {
"!url": "http://ramdajs.com/docs/#invert",
"!type": "{s: x} -> {x: [ s, ... ]}",
"!doc": "Same as [`R.invertObj`](#invertObj), however this accounts for objects with duplicate values by putting the values into an array."
},
"eqBy": {
"!url": "http://ramdajs.com/docs/#eqBy",
"!type": "(a -> b) -> a -> a -> Boolean",
"!doc": "Takes a function and two values in its domain and returns `true` if the values map to the same value in the codomain; `false` otherwise."
},
"T": {
"!url": "http://ramdajs.com/docs/#T",
"!type": "* -> Boolean",
"!doc": "A function that always returns `true`. Any passed in parameters are ignored."
},
"unfold": {
"!url": "http://ramdajs.com/docs/#unfold",
"!type": "(a -> [b]) -> * -> [b]",
"!doc": "Builds a list from a seed value. Accepts an iterator function, which returns either false to stop iteration or an array of length 2 containing the value to add to the resulting list and the seed to be used in the next call to the iterator function."
},
"takeWhile": {
"!url": "http://ramdajs.com/docs/#takeWhile",
"!type": "(a -> Boolean) -> [a] -> [a]",
"!doc": "Returns a new list containing the first `n` elements of a given list, passing each value to the supplied predicate function, and terminating when the predicate function returns `false`. Excludes the element that caused the predicate function to fail. The predicate function is passed one argument: *(value)*."
},
"reduceWhile": {
"!url": "http://ramdajs.com/docs/#reduceWhile",
"!type": "((a, b) -> Boolean) -> ((a, b) -> a) -> a -> [b] -> a",
"!doc": "Like [`reduce`](#reduce), `reduceWhile` returns a single item by iterating through the list, successively calling the iterator function. `reduceWhile` also takes a predicate that is evaluated before each step. If the predicate returns `false`, it \"short-circuits\" the iteration and returns the current value of the accumulator."
},
"omit": {
"!url": "http://ramdajs.com/docs/#omit",
"!type": "[String] -> {String: *} -> {String: *}",
"!doc": "Returns a partial copy of an object omitting the keys specified."
},
"intersection": {
"!url": "http://ramdajs.com/docs/#intersection",
"!type": "[*] -> [*] -> [*]",
"!doc": "Combines two lists into a set (i.e. no duplicates) composed of those elements common to both lists."
},
"evolve": {
"!url": "http://ramdajs.com/docs/#evolve",
"!type": "{k: (v -> v)} -> {k: v} -> {k: v}",
"!doc": "Creates a new object by recursively evolving a shallow copy of `object`, according to the `transformation` functions. All non-primitive properties are copied by reference."
},
"invertObj": {
"!url": "http://ramdajs.com/docs/#invertObj",
"!type": "{s: x} -> {x: s}",
"!doc": "Returns a new object with the keys of the given object as values, and the values of the given object, which are coerced to strings, as keys. Note that the last key found is preferred when handling the same value."
},
"lensPath": {
"!url": "http://ramdajs.com/docs/#lensPath",
"!type": "[Idx] -> Lens s a",
"!doc": "Returns a lens whose focus is the specified path."
},
"nthArg": {
"!url": "http://ramdajs.com/docs/#nthArg",
"!type": "Number -> *... -> *",
"!doc": "Returns a function which returns its nth argument."
},
"indexOf": {
"!url": "http://ramdajs.com/docs/#indexOf",
"!type": "a -> [a] -> Number",
"!doc": "Returns the position of the first occurrence of an item in an array, or -1 if the item is not included in the array. [`R.equals`](#equals) is used to determine equality."
},
"props": {
"!url": "http://ramdajs.com/docs/#props",
"!type": "[k] -> {k: v} -> [v]",
"!doc": "Acts as multiple `prop`: array of keys in, array of values out. Preserves order."
},
"complement": {
"!url": "http://ramdajs.com/docs/#complement",
"!type": "(*... -> *) -> (*... -> Boolean)",
"!doc": "Takes a function `f` and returns a function `g` such that if called with the same arguments when `f` returns a \"truthy\" value, `g` returns `false` and when `f` returns a \"falsy\" value `g` returns `true`."
},
"and": {
"!url": "http://ramdajs.com/docs/#and",
"!type": "a -> b -> a | b",
"!doc": "Returns `true` if both arguments are `true`; `false` otherwise."
},
"toString": {
"!url": "http://ramdajs.com/docs/#toString",
"!type": "* -> String",
"!doc": "Returns the string representation of the given value. `eval`'ing the output should result in a value equivalent to the input value. Many of the built-in `toString` methods do not satisfy this requirement."
},
"map": {
"!url": "http://ramdajs.com/docs/#map",
"!type": "Functor f => (a -> b) -> f a -> f b",
"!doc": "Takes a function and a [functor](https://github.com/fantasyland/fantasy-land#functor), applies the function to each of the functor's values, and returns a functor of the same shape."
},
"compose": {
"!url": "http://ramdajs.com/docs/#compose",
"!type": "((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)",
"!doc": "Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary."
},
"head": {
"!url": "http://ramdajs.com/docs/#head",
"!type": "[a] -> a | Undefined",
"!doc": "Returns the first element of the given list or string. In some libraries this function is named `first`."
},
"forEachObjIndexed": {
"!url": "http://ramdajs.com/docs/#forEachObjIndexed",
"!type": "((a, String, StrMap a) -> Any) -> StrMap a -> StrMap a",
"!doc": "Iterate over an input `object`, calling a provided function `fn` for each key and value in the object."
},
"where": {
"!url": "http://ramdajs.com/docs/#where",
"!type": "{String: (* -> Boolean)} -> {String: *} -> Boolean",
"!doc": "Takes a spec object and a test object; returns true if the test satisfies the spec. Each of the spec's own properties must be a predicate function. Each predicate is applied to the value of the corresponding property of the test object. `where` returns true if all the predicates return true, false otherwise."
},
"o": {
"!url": "http://ramdajs.com/docs/#o",
"!type": "(b -> c) -> (a -> b) -> a -> c",
"!doc": "`o` is a curried composition function that returns a unary function. Like [`compose`](#compose), `o` performs right-to-left function composition. Unlike [`compose`](#compose), the rightmost function passed to `o` will be invoked with only one argument."
},
"findIndex": {
"!url": "http://ramdajs.com/docs/#findIndex",
"!type": "(a -> Boolean) -> [a] -> Number",
"!doc": "Returns the index of the first element of the list which matches the predicate, or `-1` if no element matches."
},
"__": {
"!url": "http://ramdajs.com/docs/#__",
"!type": null,
"!doc": "A special placeholder value used to specify \"gaps\" within curried functions, allowing partial application of any combination of arguments, regardless of their positions."
},
"dropLast": {
"!url": "http://ramdajs.com/docs/#dropLast",
"!type": "Number -> [a] -> [a]",
"!doc": "Returns a list containing all but the last `n` elements of the given `list`."
},
"pipe": {
"!url": "http://ramdajs.com/docs/#pipe",
"!type": "(((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z)",
"!doc": "Performs left-to-right function composition. The leftmost function may have any arity; the remaining functions must be unary."
},
"xprod": {
"!url": "http://ramdajs.com/docs/#xprod",
"!type": "[a] -> [b] -> [[a,b]]",
"!doc": "Creates a new list out of the two supplied by creating each possible pair from the lists."
},
"tail": {
"!url": "http://ramdajs.com/docs/#tail",
"!type": "[a] -> [a]",
"!doc": "Returns all but the first element of the given list or string (or object with a `tail` method)."
},
"intersperse": {
"!url": "http://ramdajs.com/docs/#intersperse",
"!type": "a -> [a] -> [a]",
"!doc": "Creates a new list with the separator interposed between elements."
},
"product": {
"!url": "http://ramdajs.com/docs/#product",
"!type": "[Number] -> Number",
"!doc": "Multiplies together all the elements of a list."
},
"mapObjIndexed": {
"!url": "http://ramdajs.com/docs/#mapObjIndexed",
"!type": "((*, String, Object) -> *) -> Object -> Object",
"!doc": "An Object-specific version of [`map`](#map). The function is applied to three arguments: *(value, key, obj)*. If only the value is significant, use [`map`](#map) instead."
},
"constructN": {
"!url": "http://ramdajs.com/docs/#constructN",
"!type": "Number -> (* -> {*}) -> (* -> {*})",
"!doc": "Wraps a constructor function inside a curried function that can be called with the same arguments and returns the same type. The arity of the function returned is specified to allow using variadic constructor functions."
},
"clone": {
"!url": "http://ramdajs.com/docs/#clone",
"!type": "{*} -> {*}",
"!doc": "Creates a deep copy of the value which may contain (nested) `Array`s and `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are assigned by reference rather than copied"
},
"has": {
"!url": "http://ramdajs.com/docs/#has",
"!type": "s -> {s: x} -> Boolean",
"!doc": "Returns whether or not an object has an own property with the specified name"
},
"reduceBy": {
"!url": "http://ramdajs.com/docs/#reduceBy",
"!type": "((a, b) -> a) -> a -> (b -> String) -> [b] -> {String: a}",
"!doc": "Groups the elements of the list according to the result of calling the String-returning function `keyFn` on each element and reduces the elements of each group to a single value via the reducer function `valueFn`."
},
"assoc": {
"!url": "http://ramdajs.com/docs/#assoc",
"!type": "String -> a -> {k: v} -> {k: v}",
"!doc": "Makes a shallow clone of an object, setting or overriding the specified property with the given value. Note that this copies and flattens prototype properties onto the new object as well. All non-primitive properties are copied by reference."
},
"multiply": {
"!url": "http://ramdajs.com/docs/#multiply",
"!type": "Number -> Number -> Number",
"!doc": "Multiplies two numbers. Equivalent to `a * b` but curried."
},
"prop": {
"!url": "http://ramdajs.com/docs/#prop",
"!type": "s -> {s: a} -> a | Undefined",
"!doc": "Returns a function that when supplied an object returns the indicated property of that object, if it exists."
},
"merge": {
"!url": "http://ramdajs.com/docs/#merge",
"!type": "{k: v} -> {k: v} -> {k: v}",
"!doc": "Create a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects, the value from the second object will be used."
},
"identity": {
"!url": "http://ramdajs.com/docs/#identity",
"!type": "a -> a",
"!doc": "A function that does nothing but return the parameter supplied to it. Good as a default or placeholder function."
},
"findLast": {
"!url": "http://ramdajs.com/docs/#findLast",
"!type": "(a -> Boolean) -> [a] -> a | undefined",
"!doc": "Returns the last element of the list which matches the predicate, or `undefined` if no element matches."
},
"pickBy": {
"!url": "http://ramdajs.com/docs/#pickBy",
"!type": "(v, k -> Boolean) -> {k: v} -> {k: v}",
"!doc": "Returns a partial copy of an object containing only the keys that satisfy the supplied predicate."
},
"composeP": {
"!url": "http://ramdajs.com/docs/#composeP",
"!type": "((y -> Promise z), (x -> Promise y), ..., (a -> Promise b)) -> (a -> Promise z)",
"!doc": "Performs right-to-left composition of one or more Promise-returning functions. The rightmost function may have any arity; the remaining functions must be unary."
},
"subtract": {
"!url": "http://ramdajs.com/docs/#subtract",
"!type": "Number -> Number -> Number",
"!doc": "Subtracts its second argument from its first argument."
},
"mergeDeepLeft": {
"!url": "http://ramdajs.com/docs/#mergeDeepLeft",
"!type": "{a} -> {a} -> {a}",
"!doc": "Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects: - and both values are objects, the two values will be recursively merged - otherwise the value from the first object will be used."
},
"anyPass": {
"!url": "http://ramdajs.com/docs/#anyPass",
"!type": "[(*... -> Boolean)] -> (*... -> Boolean)",
"!doc": "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."
},
"lensIndex": {
"!url": "http://ramdajs.com/docs/#lensIndex",
"!type": "Number -> Lens s a",
"!doc": "Returns a lens whose focus is the specified index."
},
"uniqWith": {
"!url": "http://ramdajs.com/docs/#uniqWith",
"!type": "(a, a -> Boolean) -> [a] -> [a]",
"!doc": "Returns a new list containing only one copy of each element in the original list, based upon the value returned by applying the supplied predicate to two list elements. Prefers the first item if two items compare equal based on the predicate."
},
"remove": {
"!url": "http://ramdajs.com/docs/#remove",
"!type": "Number -> Number -> [a] -> [a]",
"!doc": "Removes the sub-list of `list` starting at index `start` and containing `count` elements. _Note that this is not destructive_: it returns a copy of the list with the changes. <small>No lists have been harmed in the application of this function.</small>"
},
"difference": {
"!url": "http://ramdajs.com/docs/#difference",
"!type": "[*] -> [*] -> [*]",
"!doc": "Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list. Objects and Arrays are compared in terms of value equality, not reference equality."
},
"gt": {
"!url": "http://ramdajs.com/docs/#gt",
"!type": "Ord a => a -> a -> Boolean",
"!doc": "Returns `true` if the first argument is greater than the second; `false` otherwise."
},
"dropLastWhile": {
"!url": "http://ramdajs.com/docs/#dropLastWhile",
"!type": "(a -> Boolean) -> [a] -> [a]",
"!doc": "Returns a new list excluding all the tailing elements of a given list which satisfy the supplied predicate function. It passes each value from the right to the supplied predicate function, skipping elements until the predicate function returns a `falsy` value. The predicate function is applied to one argument: *(value)*."
},
"useWith": {
"!url": "http://ramdajs.com/docs/#useWith",
"!type": "(x1 -> x2 -> ... -> z) -> [(a -> x1), (b -> x2), ...] -> (a -> b -> ... -> z)",
"!doc": "Accepts a function `fn` and a list of transformer functions and returns a new curried function. When the new function is invoked, it calls the function `fn` with parameters consisting of the result of calling each supplied handler on successive arguments to the new function."
},
"times": {
"!url": "http://ramdajs.com/docs/#times",
"!type": "(Number -> a) -> Number -> [a]",
"!doc": "Calls an input function `n` times, returning an array containing the results of those function calls."
},
"is": {
"!url": "http://ramdajs.com/docs/#is",
"!type": "(* -> {*}) -> a -> Boolean",
"!doc": "See if an object (`val`) is an instance of the supplied constructor. This function will check up the inheritance chain, if any."
},
"min": {
"!url": "http://ramdajs.com/docs/#min",
"!type": "Ord a => a -> a -> a",
"!doc": "Returns the smaller of its two arguments."
},
"keysIn": {
"!url": "http://ramdajs.com/docs/#keysIn",
"!type": "{k: v} -> [k]",
"!doc": "Returns a list containing the names of all the properties of the supplied object, including prototype properties. Note that the order of the output array is not guaranteed to be consistent across different JS platforms."
},
"any": {
"!url": "http://ramdajs.com/docs/#any",
"!type": "(a -> Boolean) -> [a] -> Boolean",
"!doc": "Returns `true` if at least one of elements of the list match the predicate, `false` otherwise."
},
"call": {
"!url": "http://ramdajs.com/docs/#call",
"!type": "(*... -> a),*... -> a",
"!doc": "Returns the result of calling its first argument with the remaining arguments. This is occasionally useful as a converging function for [`R.converge`](#converge): the first branch can produce a function while the remaining branches produce values to be passed to that function as its arguments."
},
"uncurryN": {
"!url": "http://ramdajs.com/docs/#uncurryN",
"!type": "Number -> (a -> b) -> (a -> c)",
"!doc": "Returns a function of arity `n` from a (manually) curried function."
},
"converge": {
"!url": "http://ramdajs.com/docs/#converge",
"!type": "(x1 -> x2 -> ... -> z) -> [(a -> b -> ... -> x1), (a -> b -> ... -> x2), ...] -> (a -> b -> ... -> z)",
"!doc": "Accepts a converging function and a list of branching functions and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value."
},
"path": {
"!url": "http://ramdajs.com/docs/#path",
"!type": "[Idx] -> {a} -> a | Undefined",
"!doc": "Retrieve the value at a given path."
},
"adjust": {
"!url": "http://ramdajs.com/docs/#adjust",
"!type": "(a -> a) -> Number -> [a] -> [a]",
"!doc": "Applies a function to the value at the given index of an array, returning a new copy of the array with the element at the given index replaced with the result of the function application."
},
"pair": {
"!url": "http://ramdajs.com/docs/#pair",
"!type": "a -> b -> (a,b)",
"!doc": "Takes two arguments, `fst` and `snd`, and returns `[fst, snd]`."
},
"indexBy": {
"!url": "http://ramdajs.com/docs/#indexBy",
"!type": "(a -> String) -> [{k: v}] -> {k: {k: v}}",
"!doc": "Given a function that generates a key, turns a list of objects into an object indexing the objects by the given key. Note that if multiple objects generate the same value for the indexing key only the last value will be included in the generated object."
},
"juxt": {
"!url": "http://ramdajs.com/docs/#juxt",
"!type": "[(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])",
"!doc": "juxt applies a list of functions to a list of values."
},
"modulo": {
"!url": "http://ramdajs.com/docs/#modulo",
"!type": "Number -> Number -> Number",
"!doc": "Divides the first parameter by the second and returns the remainder. Note that this function preserves the JavaScript-style behavior for modulo. For mathematical modulo see [`mathMod`](#mathMod)."
},
"propSatisfies": {
"!url": "http://ramdajs.com/docs/#propSatisfies",
"!type": "(a -> Boolean) -> String -> {String: a} -> Boolean",
"!doc": "Returns `true` if the specified object property satisfies the given predicate; `false` otherwise."
},
"without": {
"!url": "http://ramdajs.com/docs/#without",
"!type": "[a] -> [a] -> [a]",
"!doc": "Returns a new list without values in the first argument. [`R.equals`](#equals) is used to determine equality."
},
"into": {
"!url": "http://ramdajs.com/docs/#into",
"!type": "a -> (b -> b) -> [c] -> a",
"!doc": "Transforms the items of the list with the transducer and appends the transformed items to the accumulator using an appropriate iterator function based on the accumulator type."
},
"find": {
"!url": "http://ramdajs.com/docs/#find",
"!type": "(a -> Boolean) -> [a] -> a | undefined",
"!doc": "Returns the first element of the list which matches the predicate, or `undefined` if no element matches."
},
"contains": {
"!url": "http://ramdajs.com/docs/#contains",
"!type": "a -> [a] -> Boolean",
"!doc": "Returns `true` if the specified value is equal, in [`R.equals`](#equals) terms, to at least one element of the given list; `false` otherwise."
},
"pathEq": {
"!url": "http://ramdajs.com/docs/#pathEq",
"!type": "[Idx] -> a -> {a} -> Boolean",
"!doc": "Determines whether a nested path on an object has a specific value, in [`R.equals`](#equals) terms. Most likely used to filter a list."
},
"reduce": {
"!url": "http://ramdajs.com/docs/#reduce",
"!type": "((a, b) -> a) -> a -> [b] -> a",
"!doc": "Returns a single item by iterating through the list, successively calling the iterator function and passing it an accumulator value and the current value from the array, and then passing the result to the next call."
},
"union": {
"!url": "http://ramdajs.com/docs/#union",
"!type": "[*] -> [*] -> [*]",
"!doc": "Combines two lists into a set (i.e. no duplicates) composed of the elements of each list."
},
"bind": {
"!url": "http://ramdajs.com/docs/#bind",
"!type": "(* -> *) -> {*} -> (* -> *)",
"!doc": "Creates a function that is bound to a context. Note: `R.bind` does not provide the additional argument-binding capabilities of [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)."
},
"groupBy": {
"!url": "http://ramdajs.com/docs/#groupBy",
"!type": "(a -> String) -> [a] -> {String: [a]}",
"!doc": "Splits a list into sub-lists stored in an object, based on the result of calling a String-returning function on each element, and grouping the results according to values returned."
},
"over": {
"!url": "http://ramdajs.com/docs/#over",
"!type": "Lens s a -> (a -> a) -> s -> s",
"!doc": "Returns the result of \"setting\" the portion of the given data structure focused by the given lens to the result of applying the given function to the focused value."
},
"flatten": {
"!url": "http://ramdajs.com/docs/#flatten",
"!type": "[a] -> [b]",
"!doc": "Returns a new list by pulling every item out of it (and all its sub-arrays) and putting them in a new array, depth-first."
},
"takeLastWhile": {
"!url": "http://ramdajs.com/docs/#takeLastWhile",
"!type": "(a -> Boolean) -> [a] -> [a]",
"!doc": "Returns a new list containing the last `n` elements of a given list, passing each value to the supplied predicate function, and terminating when the predicate function returns `false`. Excludes the element that caused the predicate function to fail. The predicate function is passed one argument: *(value)*."
},
"propIs": {
"!url": "http://ramdajs.com/docs/#propIs",
"!type": "Type -> String -> Object -> Boolean",
"!doc": "Returns `true` if the specified object property is of the given type; `false` otherwise."
},
"takeLast": {
"!url": "http://ramdajs.com/docs/#takeLast",
"!type": "Number -> [a] -> [a]",
"!doc": "Returns a new list containing the last `n` elements of the given list. If `n > list.length`, returns a list of `list.length` elements."
},
"mapAccum": {
"!url": "http://ramdajs.com/docs/#mapAccum",
"!type": "(acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])",
"!doc": "The `mapAccum` function behaves like a combination of map and reduce; it applies a function to each element of a list, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list."
},
"symmetricDifference": {
"!url": "http://ramdajs.com/docs/#symmetricDifference",
"!type": "[*] -> [*] -> [*]",
"!doc": "Finds the set (i.e. no duplicates) of all elements contained in the first or second list, but not both."
},
"set": {
"!url": "http://ramdajs.com/docs/#set",
"!type": "Lens s a -> a -> s -> s",
"!doc": "Returns the result of \"setting\" the portion of the given data structure focused by the given lens to the given value."
},
"defaultTo": {
"!url": "http://ramdajs.com/docs/#defaultTo",
"!type": "a -> b -> a | b",
"!doc": "Returns the second argument if it is not `null`, `undefined` or `NaN`; otherwise the first argument is returned."
},
"pipeP": {
"!url": "http://ramdajs.com/docs/#pipeP",
"!type": "((a -> Promise b), (b -> Promise c), ..., (y -> Promise z)) -> (a -> Promise z)",
"!doc": "Performs left-to-right composition of one or more Promise-returning functions. The leftmost function may have any arity; the remaining functions must be unary."
},
"binary": {
"!url": "http://ramdajs.com/docs/#binary",
"!type": "(* -> c) -> (a, b -> c)",
"!doc": "Wraps a function of any arity (including nullary) in a function that accepts exactly 2 parameters. Any extraneous parameters will not be passed to the supplied function."
},
"dropWhile": {
"!url": "http://ramdajs.com/docs/#dropWhile",
"!type": "(a -> Boolean) -> [a] -> [a]",
"!doc": "Returns a new list excluding the leading elements of a given list which satisfy the supplied predicate function. It passes each value to the supplied predicate function, skipping elements while the predicate function returns `true`. The predicate function is applied to one argument: *(value)*."
},
"pipeK": {
"!url": "http://ramdajs.com/docs/#pipeK",
"!type": "Chain m => ((a -> m b), (b -> m c), ..., (y -> m z)) -> (a -> m z)",
"!doc": "Returns the left-to-right Kleisli composition of the provided functions, each of which must return a value of a type supported by [`chain`](#chain)."
},
"slice": {
"!url": "http://ramdajs.com/docs/#slice",
"!type": "Number -> Number -> [a] -> [a]",
"!doc": "Returns the elements of the given list or string (or object with a `slice` method) from `fromIndex` (inclusive) to `toIndex` (exclusive)."
},
"forEach": {
"!url": "http://ramdajs.com/docs/#forEach",
"!type": "(a -> *) -> [a] -> [a]",
"!doc": "Iterate over an input `list`, calling a provided function `fn` for each element in the list."
},
"dissocPath": {
"!url": "http://ramdajs.com/docs/#dissocPath",
"!type": "[Idx] -> {k: v} -> {k: v}",
"!doc": "Makes a shallow clone of an object, omitting the property at the given path. Note that this copies and flattens prototype properties onto the new object as well. All non-primitive properties are copied by reference."
},
"propEq": {
"!url": "http://ramdajs.com/docs/#propEq",
"!type": "String -> a -> Object -> Boolean",
"!doc": "Returns `true` if the specified object property is equal, in [`R.equals`](#equals) terms, to the given value; `false` otherwise."
},
"isNil": {
"!url": "http://ramdajs.com/docs/#isNil",
"!type": "* -> Boolean",
"!doc": "Checks if the input value is `null` or `undefined`."
},
"when": {
"!url": "http://ramdajs.com/docs/#when",
"!type": "(a -> Boolean) -> (a -> a) -> a -> a",
"!doc": "Tests the final argument by passing it to the given predicate function. If the predicate is satisfied, the function will return the result of calling the `whenTrueFn` function with the same argument. If the predicate is not satisfied, the argument is returned as is."
},
"maxBy": {
"!url": "http://ramdajs.com/docs/#maxBy",
"!type": "Ord b => (a -> b) -> a -> a -> a",
"!doc": "Takes a function and two values, and returns whichever value produces the larger result when passed to the provided function."
},
"tap": {
"!url": "http://ramdajs.com/docs/#tap",
"!type": "(a -> *) -> a -> a",
"!doc": "Runs the given function with the supplied object, then returns the object."
},
"join": {
"!url": "http://ramdajs.com/docs/#join",
"!type": "String -> [a] -> String",
"!doc": "Returns a string made by inserting the `separator` between each element and concatenating all the elements into a single string."
},
"dissoc": {
"!url": "http://ramdajs.com/docs/#dissoc",
"!type": "String -> {k: v} -> {k: v}",
"!doc": "Returns a new object that does not contain a `prop` property."
},
"splitEvery": {
"!url": "http://ramdajs.com/docs/#splitEvery",
"!type": "Number -> [a] -> [[a]]",
"!doc": "Splits a collection into slices of the specified length."
},
"mergeDeepRight": {
"!url": "http://ramdajs.com/docs/#mergeDeepRight",
"!type": "{a} -> {a} -> {a}",
"!doc": "Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects: - and both values are objects, the two values will be recursively merged - otherwise the value from the second object will be used."
},
"none": {
"!url": "http://ramdajs.com/docs/#none",
"!type": "(a -> Boolean) -> [a] -> Boolean",
"!doc": "Returns `true` if no elements of the list match the predicate, `false` otherwise."
},
"keys": {
"!url": "http://ramdajs.com/docs/#keys",
"!type": "{k: v} -> [k]",
"!doc": "Returns a list containing the names of all the enumerable own properties of the supplied object. Note that the order of the output array is not guaranteed to be consistent across different JS platforms."
},
"once": {
"!url": "http://ramdajs.com/docs/#once",
"!type": "(a... -> b) -> (a... -> b)",
"!doc": "Accepts a function `fn` and returns a function that guards invocation of `fn` such that `fn` can only ever be called once, no matter how many times the returned function is invoked. The first value calculated is returned in subsequent invocations."
},
"unary": {
"!url": "http://ramdajs.com/docs/#unary",
"!type": "(* -> b) -> (a -> b)",
"!doc": "Wraps a function of any arity (including nullary) in a function that accepts exactly 1 parameter. Any extraneous parameters will not be passed to the supplied function."
},
"split": {
"!url": "http://ramdajs.com/docs/#split",
"!type": "(String | RegExp) -> String -> [String]",
"!doc": "Splits a string into an array of strings based on the given separator."
},
"last": {
"!url": "http://ramdajs.com/docs/#last",
"!type": "[a] -> a | Undefined",
"!doc": "Returns the last element of the given list or string."
},
"mergeDeepWith": {
"!url": "http://ramdajs.com/docs/#mergeDeepWith",
"!type": "(a -> a -> a) -> {a} -> {a} -> {a}",
"!doc": "Creates a new object with the own properties of the two provided objects. If a key exists in both objects: - and both associated values are also objects then the values will be recursively merged. - otherwise the provided function is applied to associated values using the resulting value as the new value associated with the key. If a key only exists in one object, the value will be associated with the key of the resulting object."
},
"findLastIndex": {
"!url": "http://ramdajs.com/docs/#findLastIndex",
"!type": "(a -> Boolean) -> [a] -> Number",
"!doc": "Returns the index of the last element of the list which matches the predicate, or `-1` if no element matches."
},
"tryCatch": {
"!url": "http://ramdajs.com/docs/#tryCatch",
"!type": "(...x -> a) -> ((e, ...x) -> a) -> (...x -> a)",
"!doc": "`tryCatch` takes two functions, a `tryer` and a `catcher`. The returned function evaluates the `tryer`; if it does not throw, it simply returns the result. If the `tryer` *does* throw, the returned function evaluates the `catcher` function and returns its result. Note that for effective composition with this function, both the `tryer` and `catcher` functions must return the same type of results."
},
"values": {
"!url": "http://ramdajs.com/docs/#values",
"!type": "{k: v} -> [v]",
"!doc": "Returns a list of all the enumerable own properties of the supplied object. Note that the order of the output array is not guaranteed across different JS platforms."
},
"lensProp": {
"!url": "http://ramdajs.com/docs/#lensProp",
"!type": "String -> Lens s a",
"!doc": "Returns a lens whose focus is the specified property."
},
"partial": {
"!url": "http://ramdajs.com/docs/#partial",
"!type": "((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)",
"!doc": "Takes a function `f` and a list of arguments, and returns a function `g`. When applied, `g` returns the result of applying `f` to the arguments provided initially followed by the arguments provided to `g`."
},
"update": {
"!url": "http://ramdajs.com/docs/#update",
"!type": "Number -> a -> [a] -> [a]",
"!doc": "Returns a new copy of the array with the element at the provided index replaced with the given value."
},
"clamp": {
"!url": "http://ramdajs.com/docs/#clamp",
"!type": "Ord a => a -> a -> a -> a",
"!doc": "Restricts a number to be within a range."
},
"insert": {
"!url": "http://ramdajs.com/docs/#insert",
"!type": "Number -> a -> [a] -> [a]",
"!doc": "Inserts the supplied element into the list, at the specified `index`. _Note that this is not destructive_: it returns a copy of the list with the changes. <small>No lists have been harmed in the application of this function.</small>"
},
"uniq": {
"!url": "http://ramdajs.com/docs/#uniq",
"!type": "[a] -> [a]",
"!doc": "Returns a new list containing only one copy of each element in the original list. [`R.equals`](#equals) is used to determine equality."
},
"pickAll": {
"!url": "http://ramdajs.com/docs/#pickAll",
"!type": "[k] -> {k: v} -> {k: v}",
"!doc": "Similar to `pick` except that this one includes a `key: undefined` pair for properties that don't exist."
},
"lens": {
"!url": "http://ramdajs.com/docs/#lens",
"!type": "(s -> a) -> ((a, s) -> s) -> Lens s a",
"!doc": "Returns a lens for the given getter and setter functions. The getter \"gets\" the value of the focus; the setter \"sets\" the value of the focus. The setter should not mutate the data structure."
},
"composeK": {
"!url": "http://ramdajs.com/docs/#composeK",
"!type": "Chain m => ((y -> m z), (x -> m y), ..., (a -> m b)) -> (a -> m z)",
"!doc": "Returns the right-to-left Kleisli composition of the provided functions, each of which must return a value of a type supported by [`chain`](#chain)."
},
"median": {
"!url": "http://ramdajs.com/docs/#median",
"!type": "[Number] -> Number",
"!doc": "Returns the median of the given list of numbers."
},
"traverse": {
"!url": "http://ramdajs.com/docs/#traverse",
"!type": "(Applicative f, Traversable t) => (a -> f a) -> (a -> f b) -> t a -> f (t b)",
"!doc": "Maps an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning function over a [Traversable](https://github.com/fantasyland/fantasy-land#traversable), then uses [`sequence`](#sequence) to transform the resulting Traversable of Applicative into an Applicative of Traversable."
},
"unnest": {
"!url": "http://ramdajs.com/docs/#unnest",
"!type": "Chain c => c (c a) -> c a",
"!doc": "Shorthand for `R.chain(R.identity)`, which removes one level of nesting from any [Chain](https://github.com/fantasyland/fantasy-land#chain)."
},
"pathOr": {
"!url": "http://ramdajs.com/docs/#pathOr",
"!type": "a -> [Idx] -> {a} -> a",
"!doc": "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."
},
"applySpec": {
"!url": "http://ramdajs.com/docs/#applySpec",
"!type": "{k: ((a, b, ..., m) -> v)} -> ((a, b, ..., m) -> {k: v})",
"!doc": "Given a spec object recursively mapping properties to functions, creates a function producing an object of the same structure, by mapping each property to the result of calling its associated function with the supplied arguments."
},
"partialRight": {
"!url": "http://ramdajs.com/docs/#partialRight",
"!type": "((a, b, c, ..., n) -> x) -> [d, e, f, ..., n] -> ((a, b, c, ...) -> x)",
"!doc": "Takes a function `f` and a list of arguments, and returns a function `g`. When applied, `g` returns the result of applying `f` to the arguments provided to `g` followed by the arguments provided initially."
},
"curry": {
"!url": "http://ramdajs.com/docs/#curry",
"!type": "(* -> a) -> (* -> a)",
"!doc": "Returns a curried equivalent of the provided function. The curried function has two unusual capabilities. First, its arguments needn't be provided one at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the following are equivalent:"
},
"repeat": {
"!url": "http://ramdajs.com/docs/#repeat",
"!type": "a -> n -> [a]",
"!doc": "Returns a fixed list of size `n` containing a specified identical value."
},
"unionWith": {
"!url": "http://ramdajs.com/docs/#unionWith",
"!type": "(a -> a -> Boolean) -> [*] -> [*] -> [*]",
"!doc": "Combines two lists into a set (i.e. no duplicates) composed of the elements of each list. Duplication is determined according to the value returned by applying the supplied predicate to two list elements."
},
"reduced": {
"!url": "http://ramdajs.com/docs/#reduced",
"!type": "a -> *",
"!doc": "Returns a value wrapped to indicate that it is the final value of the reduce and transduce functions. The returned value should be considered a black box: the internal structure is not guaranteed to be stable."
},
"always": {
"!url": "http://ramdajs.com/docs/#always",
"!type": "a -> (* -> a)",
"!doc": "Returns a function that always returns the given value. Note that for non-primitives the value returned is a reference to the original value."
},
"divide": {
"!url": "http://ramdajs.com/docs/#divide",
"!type": "Number -> Number -> Number",
"!doc": "Divides two numbers. Equivalent to `a / b`."
},
"filter": {
"!url": "http://ramdajs.com/docs/#filter",
"!type": "Filterable f => (a -> Boolean) -> f a -> f a",
"!doc": "Takes a predicate and a `Filterable`, and returns a new filterable of the same type containing the members of the given filterable which satisfy the given predicate. Filterable objects include plain objects or any object that has a filter method such as `Array`."
},
"intersectionWith": {
"!url": "http://ramdajs.com/docs/#intersectionWith",
"!type": "((a, a) -> Boolean) -> [a] -> [a] -> [a]",
"!doc": "Combines two lists into a set (i.e. no duplicates) composed of those elements common to both lists. Duplication is determined according to the value returned by applying the supplied predicate to two list elements."
},
"isEmpty": {
"!url": "http://ramdajs.com/docs/#isEmpty",
"!type": "a -> Boolean",
"!doc": "Returns `true` if the given value is its type's empty value; `false` otherwise."
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment