text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Lamda Documentation</title>
	<link rel="stylesheet" type="text/css" href="./style.css">
	<link rel="stylesheet" type="text/css" href="./dracula.css">

	<input type="checkbox" id="open-nav">

					Lamda
					v0.2.0

GitHub

					R.reduceRight

					R.adjust
					Array

					R.all
					Array

					R.any
					Array

					R.aperture
					Array

					R.append
					Array

					R.assoc
					Array

					R.assocPath
					Array

					R.chain
					Array

					R.concat
					Array

					R.contains
					Array

					R.difference
					Array

					R.differenceWith
					Array

					R.dissoc
					Array

					R.dissocPath
					Array

					R.drop
					Array

					R.dropLast
					Array

					R.dropLastWhile
					Array

					R.dropWhile
					Array

					R.find
					Array

					R.findIndex
					Array

					R.findLast
					Array

					R.findLastIndex
					Array

					R.flatten
					Array

					R.groupBy
					Array

					R.groupWith
					Array

					R.head
					Array

					R.includes
					Array

					R.indexBy
					Array

					R.init
					Array

					R.innerJoin
					Array

					R.insert
					Array

					R.insertAll
					Array

					R.intersection
					Array

					R.intersperse
					Array

					R.last
					Array

					R.lastIndexOf
					Array

					R.length
					Array

					R.none
					Array

					R.nth
					Array

					R.pair
					Array

					R.partition
					Array

					R.pluck
					Array

					R.prepend
					Array

					R.push
					Array

					R.range
					Array

					R.reduce
					Array

					R.reduceBy
					Array

					R.reduceWhile
					Array

					R.reject
					Array

					R.remove
					Array

					R.repeat_
					Array

					R.reverse
					Array

					R.scan
					Array

					R.size
					Array

					R.slice
					Array

					R.sort
					Array

					R.sortWith
					Array

					R.splitAt
					Array

					R.splitEvery
					Array

					R.splitWhen
					Array

					R.tail
					Array

					R.take
					Array

					R.takeLast
					Array

					R.takeLastWhile
					Array

					R.takeWhile
					Array

					R.times
					Array

					R.transpose
					Array

					R.unfold
					Array

					R.union
					Array

					R.unionWith
					Array

					R.uniq
					Array

					R.uniqBy
					Array

					R.uniqWith
					Array

					R.unnest
					Array

					R.unshift
					Array

					R.update
					Array

					R.without
					Array

					R.xprod
					Array

					R.zip
					Array

					R.zipObj
					Array

					R.zipWith
					Array

					R.F
					Functional

					R.T
					Functional

					R.allPass
					Functional

					R.always
					Functional

					R.and_
					Functional

					R.anyPass
					Functional

					R.apply
					Functional

					R.ascend
					Functional

					R.binary
					Functional

					R.bind
					Functional

					R.both
					Functional

					R.call
					Functional

					R.comparator
					Functional

					R.complement
					Functional

					R.compose
					Functional

					R.cond
					Functional

					R.converge
					Functional

					R.curry1
					Functional

					R.curry2
					Functional

					R.curry3
					Functional

					R.curryN
					Functional

					R.descend
					Functional

					R.either
					Functional

					R.flip
					Functional

					R.identity
					Functional

					R.ifElse
					Functional

					R.juxt
					Functional

					R.map
					Functional

					R.mapAccum
					Functional

					R.mapAccumRight
					Functional

					R.memoize
					Functional

					R.memoizeWith
					Functional

					R.mirror
					Functional

					R.mirrorBy
					Functional

					R.nAry
					Functional

					R.not_
					Functional

					R.o
					Functional

					R.of
					Functional

					R.once
					Functional

					R.or_
					Functional

					R.partial
					Functional

					R.partialRight
					Functional

					R.pipe
					Functional

					R.tap
					Functional

					R.tryCatch
					Functional

					R.unapply
					Functional

					R.unary
					Functional

					R.unless
					Functional

					R.until_
					Functional

					R.useWith
					Functional

					R.when
					Functional

					R.abs
					Math

					R.add
					Math

					R.clamp
					Math

					R.dec
					Math

					R.divide
					Math

					R.inc
					Math

					R.mean
					Math

					R.median
					Math

					R.minus
					Math

					R.mod
					Math

					R.multiply
					Math

					R.negate
					Math

					R.plus
					Math

					R.product
					Math

					R.subtract
					Math

					R.sum
					Math

					R.clone
					Object

					R.eqProps
					Object

					R.filter
					Object

					R.forEach
					Object

					R.fromPairs
					Object

					R.has
					Object

					R.invert
					Object

					R.invertObj
					Object

					R.keys
					Object

					R.merge
					Object

					R.mergeAll
					Object

					R.mergeDeepLeft
					Object

					R.mergeDeepRight
					Object

					R.mergeDeepWith
					Object

					R.mergeDeepWithKey
					Object

					R.mergeWith
					Object

					R.mergeWithKey
					Object

					R.objOf
					Object

					R.omit
					Object

					R.path
					Object

					R.pathEq
					Object

					R.pathOr
					Object

					R.pathSatisfies
					Object

					R.pick
					Object

					R.pickAll
					Object

					R.pickBy
					Object

					R.prop
					Object

					R.propEq
					Object

					R.propIs
					Object

					R.propOr
					Object

					R.propSatisfies
					Object

					R.props
					Object

					R.skeys
					Object

					R.sortedKeys
					Object

					R.toPairs
					Object

					R.values
					Object

					R.where
					Object

					R.whereEq
					Object

					R.boxMullerSampling
					Random

					R.choice
					Random

					R.normalDistributed
					Random

					R.randrange
					Random

					R.sample
					Random

					R.shuffle
					Random

					R.endsWith
					String

					R.indexOf
					String

					R.join
					String

					R.match
					String

					R.replace
					String

					R.split
					String

					R.startsWith
					String

					R.strip
					String

					R.test
					String

					R.toLower
					String

					R.toUpper
					String

					R.trim
					String

					R.count
					Util

					R.countBy
					Util

					R.defaultTo
					Util

					R.empty
					Util

					R.eqBy
					Util

					R.equals
					Util

					R.first
					Util

					R.gt
					Util

					R.gte
					Util

					R.is
					Util

					R.isArray
					Util

					R.isBoolean
					Util

					R.isEmpty
					Util

					R.isFunction
					Util

					R.isInf
					Util

					R.isInteger
					Util

					R.isNan
					Util

					R.isNil
					Util

					R.isNull
					Util

					R.isNumber
					Util

					R.isObject
					Util

					R.isSafeArray
					Util

					R.isSafeBoolean
					Util

					R.isSafeFunction
					Util

					R.isSafeInf
					Util

					R.isSafeInteger
					Util

					R.isSafeNan
					Util

					R.isSafeNumber
					Util

					R.isSafeObject
					Util

					R.isSafeString
					Util

					R.isSafeTable
					Util

					R.isSafeThread
					Util

					R.isSafeUserData
					Util

					R.isString
					Util

					R.isTable
					Util

					R.isThread
					Util

					R.isUserData
					Util

					R.lt
					Util

					R.lte
					Util

					R.max
					Util

					R.maxBy
					Util

					R.min
					Util

					R.minBy
					Util

					R.pack
					Util

					R.project
					Util

					R.safeEquals
					Util

					R.same
					Util

					R.second
					Util

					R.show
					Util

					R.symmetricDifference
					Util

					R.symmetricDifferenceWith
					Util

					R.toJson
					Util

					R.toString
					Util

				R.reduceRight

Added in v0.1.0

(a, b -> b) -> b -> [a] -> b

	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.		Similar to [`reduce`](#reduce), except moves through the input list from the	right to the left.		The iterator function receives two values: *(value, acc)*, while the arguments'	order of `reduce`'s iterator function is *(acc, value)*.

see R.reduce

		R.reduceRight(R.subtract, 0, {1, 2, 3, 4}) --> (1 - (2 - (3 - (4 - 0)))) = -2
		--   -               -2
		--  / \              / \
		-- 1   -            1   3
		--    / \              / \
		--   2   -     ==>    2  -1
		--      / \              / \
		--     3   -            3   4
		--        / \              / \
		--       4   0            4   0

				R.adjust

					Array

Added in v0.1.0

(a -> a) -> Number -> [a] -> [a]

	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.

see R.update

		R.adjust(R.add(10), 2, {1, 2, 3})     --> {1, 12, 3}
		R.adjust(R.add(10))(2)({1, 2, 3})     --> {1, 12, 3}

				R.all

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> Boolean

	Returns `true` if all elements of the list match the predicate, `false` if	there are any that don't.		Dispatches to the `all` method of the second argument, if present.

see R.any,R.none

		local equals3 = R.equals(3)
		R.all(equals3, {3, 3, 3, 3}) --> true
		R.all(equals3)({3, 3, 1, 3}) --> false

				R.any

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> Boolean

	Returns `true` if at least one of elements of the list match the predicate,	`false` otherwise.

see R.all,R.none

		local lessThan0 = R.lt(R.__, 0)
		local lessThan2 = R.lt(R.__, 2)
		R.any(lessThan0, {1, 2}) --> false
		R.any(lessThan2)({1, 2}) --> true

				R.aperture

					Array

Added in v0.1.0

Number -> [a] -> [ [a] ]

	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.

		R.aperture(2, {1, 2, 3, 4, 5}) --> {{1, 2}, {2, 3}, {3, 4}, {4, 5}}
		R.aperture(3, {1, 2, 3, 4, 5}) --> {{1, 2, 3}, {2, 3, 4}, {3, 4, 5}}
		R.aperture(7, {1, 2, 3, 4, 5}) --> {}
		R.aperture(0, {1, 2, 3, 4, 5}) --> {{}, {}, {}, {}, {}, {}}

				R.append

					Array

Added in v0.1.0

a -> [a] -> [a]

	Returns a new list containing the contents of the given list, followed by	the given element.

see R.prepend

		R.append('tests', {'write', 'more'}) --> {'write', 'more', 'tests'}
		R.append('tests', {}) --> {'tests'}
		R.append({'tests'}, {'write', 'more'}) --> {'write', 'more', {'tests'}}

				R.assoc

					Array

Added in v0.1.0

String -> a -> {k: v} -> {k: v}

	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.

see R.dissoc

		R.assoc('c', 3, {a = 1, b = 2}) --> {a = 1, b = 2, c = 3}

				R.assocPath

					Array

Added in v0.1.0

[Idx] -> a -> {a} -> {a}

	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.

see R.dissocPath

		R.assocPath({'a', 'b', 'c'}, 42, {a = {b = {c = 0}}}) --> {a = {b = {c = 42}}}
		-- Any missing or non-object keys in path will be overridden
		R.assocPath({'a', 'b', 'c'}, 42, {a = 5}) --> {a = {b = {c = 42}}}

				R.chain

					Array

Added in v0.1.0

Chain m => (a -> m b) -> m a -> m b

	`chain` maps a function over a list and concatenates the results. `chain`	is also known as `flatMap` in some libraries.	If second param is function, chain(f, g)(x) equals f(g(x), x).

		local duplicate = function(n) return {n, n} end
		R.chain(duplicate, {1, 2, 3}) --> {1, 1, 2, 2, 3, 3}
		R.chain(R.append, R.head)({1, 2, 3}) --> {1, 2, 3, 1}

				R.concat

					Array

Added in v0.1.0

String -> String -> String

	Returns the result of concatenating the given lists or strings.     	Note: `R.concat` expects both arguments to be of the same type as array or string

		R.concat('ABC', 'DEF') --> 'ABCDEF'
		R.concat([4, 5, 6], [1, 2, 3]) --> [4, 5, 6, 1, 2, 3]
		R.concat([], []) --> []

				R.contains

					Array

Added in v0.1.0

a -> [a] -> Boolean

	Returns `true` if the specified value is equal, in [`R.equals`](#equals)	terms, to at least one element of the given list `false` otherwise.

see R.any

		R.contains(3, {1, 2, 3}) --> true
		R.contains(4, {1, 2, 3}) --> false
		R.contains({ name = 'Fred' }, {{ name = 'Fred' }}) --> true
		R.contains({42}, {{42}}) --> true

				R.difference

					Array

Added in v0.1.0

[*] -> [*] -> [*]

	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.

see R.differenceWith,R.symmetricDifference,R.symmetricDifferenceWith,R.without

		R.difference({1,2,3,4}, {7,6,5,4,3}) --> {1,2}
		R.difference({7,6,5,4,3}, {1,2,3,4}) --> {7,6,5}
		R.difference({{a = 1}, {b = 2}}, {{a = 1}, {c = 3}}) --> {{b = 2}}

				R.differenceWith

					Array

Added in v0.1.0

((a, a) -> Boolean) -> [a] -> [a] -> [a]

	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.

see R.difference,R.symmetricDifference,R.symmetricDifferenceWith

		local cmp = function(x, y) return x.a == y.a end
		local l1 = {{a = 1}, {a = 2}, {a = 3}}
		local l2 = {{a = 3}, {a = 4}}
		R.differenceWith(cmp, l1, l2) --> {{a = 1}, {a = 2}}

				R.dissoc

					Array

Added in v0.1.0

String -> {k: v} -> {k: v}

	Returns a new object that does not contain a `prop` property.	All non-primitive properties are copied by reference.

see R.assoc

		R.dissoc('b', {a = 1, b = 2, c = 3}) --> {a = 1, c = 3}

				R.dissocPath

					Array

Added in v0.1.0

[Idx] -> {k: v} -> {k: v}

	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.

see R.assocPath

		R.dissocPath({'a', 'b', 'c'}, {a = {b = {c = 42}}}) --> {a = {b = {}}}

				R.drop

					Array

Added in v0.1.0

Number -> String -> String

	Returns all but the first `n` elements of the given list, string, or	transducer/transformer (or object with a `drop` method).

see R.take,R.transduce,R.dropLast,R.dropWhile

		R.drop(1, {'foo', 'bar', 'baz'}) --> {'bar', 'baz'}
		R.drop(2, {'foo', 'bar', 'baz'}) --> {'baz'}
		R.drop(3, {'foo', 'bar', 'baz'}) --> {}
		R.drop(4, {'foo', 'bar', 'baz'}) --> {}
		R.drop(3, 'ramda')               --> 'da'

				R.dropLast

					Array

Added in v0.1.0

Number -> String -> String

	Returns a list containing all but the last `n` elements of the given `list`.

see R.takeLast,R.drop,R.dropWhile,R.dropLastWhile

		R.dropLast(1, {'foo', 'bar', 'baz'}) --> {'foo', 'bar'}
		R.dropLast(2, {'foo', 'bar', 'baz'}) --> {'foo'}
		R.dropLast(3, {'foo', 'bar', 'baz'}) --> {}
		R.dropLast(4, {'foo', 'bar', 'baz'}) --> {}
		R.dropLast(3, 'lamda')               --> 'la'

				R.dropLastWhile

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> [a]

	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)*.

see R.takeLastWhile,R.drop,R.dropWhile

		R.dropLastWhile(R.gte(3), {1, 2, 3, 4, 3, 2, 1}) --> {1, 2, 3, 4}

				R.dropWhile

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> [a]

	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)*.

see R.takeWhile

		R.dropWhile(R.gte(2), {1, 2, 3, 4, 3, 2, 1}) --> {3, 4, 3, 2, 1}

				R.find

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> a | nil

	Returns the first element of the list which matches the predicate, or	`nil` if no element matches.		If `predicate` is not a function, use R.equals to check it's value

		local xs = {{a = 1}, {a = 2}, {a = 3}}
		R.find(R.propEq('a', 2))(xs) --> {a = 2}
		R.find(R.propEq('a', 4))(xs) --> nil

				R.findIndex

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> Number

	Returns the index of the first element of the list which matches the	predicate, or `-1` if no element matches.

		local xs = {{a = 1}, {a = 2}, {a = 3}}
		R.findIndex(R.propEq('a', 2))(xs) --> 2
		R.findIndex(R.propEq('a', 4))(xs) --> -1

				R.findLast

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> a | nil

	Returns the last element of the list which matches the predicate, or	`nil` if no element matches.

		local xs = {{a = 1, b = 0}, {a = 1, b = 1}}
		R.findLast(R.propEq('a', 1))(xs) --> {a = 1, b = 1}
		R.findLast(R.propEq('a', 4))(xs) --> nil

				R.findLastIndex

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> Number

	Returns the index of the last element of the list which matches the	predicate, or `-1` if no element matches.

		local xs = {{a = 1, b = 0}, {a = 1, b = 1}}
		R.findLastIndex(R.propEq('a', 1))(xs) --> 1
		R.findLastIndex(R.propEq('a', 4))(xs) --> -1

				R.flatten

					Array

Added in v0.1.0

[a] -> [b]

	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.

see R.unnest

		R.flatten({1, 2, {3, 4}, 5, {6, {7, 8, {9, {10, 11}, 12}}}})
		--> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}

				R.groupBy

					Array

Added in v0.1.0

(a -> String) -> [a] -> {String: [a]}

	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.

		local byGrade = R.groupBy(function(student)
			local score = student.score
			return score < 65 and 'F' or
					score < 70 and 'D' or
					score < 80 and 'C' or
					score < 90 and 'B' or 'A'
		end)
		local students = {{name = 'Lucy', score = 92},
					{name = 'Drew', score = 85},
					{name = 'Leo', score = 90},
					{name = 'Bart', score = 62}}
		byGrade(students)
		--> {
		-- 	A={{name="Lucy", score=92}, {name="Leo", score=90}},
		-- 	B={{name="Drew", score=85}},
		-- 	F={{name="Bart", score=62}}
		-- }

				R.groupWith

					Array

Added in v0.1.0

((a, a) → Boolean) → [a] → [ [a] ]

	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.

		print(R.toString(R.groupWith(R.equals, {0, 1, 1, 2, 3, 5, 8, 13, 21})))
		--> {{0}, {1, 1}, {2}, {3}, {5}, {8}, {13}, {21}}
		print(R.toString(R.groupWith(function(a, b) return a + 1 == b end, {0, 1, 1, 2, 3, 5, 8, 13, 21})))
		--> {{0, 1}, {1, 2, 3}, {5}, {8}, {13}, {21}}
		print(R.toString(R.groupWith(function(a, b) return a % 2 == b % 2 end, {0, 1, 1, 2, 3, 5, 8, 13, 21})))
		--> {{0}, {1, 1}, {2}, {3, 5}, {8}, {13, 21}}
		print(R.toString(R.groupWith(R.eqBy(R.contains(R.__, "aeiou")), 'aestiou')))
		--> {'ae', 'st', 'iou'}

				R.head

					Array

Added in v0.1.0

String -> String

	Returns the first element of the given list or string. In some libraries	this function is named `first`.

see R.tail,R.init,R.last

		R.head({'fi', 'fo', 'fum'}) --> 'fi'
		R.head({}) --> nil
		R.head('abc') --> 'a'
		R.head('') --> ''

				R.includes

					Array

Added in v0.1.0

Alias To R.contains

				R.indexBy

					Array

Added in v0.1.0

(a -> String) -> [{k: v}] -> {k: {k: v}}

	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.

		local list = {{id = 'xyz', title = 'A'}, {id = 'abc', title = 'B'}}
		R.indexBy(R.prop('id'), list)
		--> {abc: {id = 'abc', title = 'B'}, xyz: {id = 'xyz', title = 'A'}}

				R.init

					Array

Added in v0.1.0

String -> String

	Returns all but the last element of the given list or string.

see R.last,R.head,R.tail

		R.init({1, 2, 3})  --> {1,2}
		R.init({1, 2})     --> {1}
		R.init({1})        --> {}
		R.init({})         --> {}

		R.init('abc')  --> 'ab'
		R.init('ab')   --> 'a'
		R.init('a')    --> ''
		R.init('')     --> ''

				R.innerJoin

					Array

Added in v0.1.0

(a -> b -> Boolean) -> [a] -> [b] -> [a]

	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`.		`pred` must be a binary function expecting an element from each list.		`xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should	not be significant, but since `xs'` is ordered the implementation guarantees	that its values are in the same order as they appear in `xs`. Duplicates are	not removed, so `xs'` may contain duplicates if `xs` contains duplicates.

see R.intersection

		R.innerJoin(
			function(data, id) return data.id == id end,
			{{id = 824, name = 'Richie Furay'},
				{id = 956, name = 'Dewey Martin'},
				{id = 313, name = 'Bruce Palmer'},
				{id = 456, name = 'Stephen Stills'},
				{id = 177, name = 'Neil Young'}},
			{177, 456, 999}
		) --> {{name = "Stephen Stills",id = 456},{name = "Neil Young",id = 177}}

				R.insert

					Array

Added in v0.1.0

Number -> a -> [a] -> [a]

	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.	No lists have been harmed in the application of this function.

		R.insert(2, 'x', {1,2,3,4}) --> {1,2,'x',3,4}

				R.insertAll

					Array

Added in v0.1.0

Number -> [a] -> [a] -> [a]

	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.	No lists have been harmed in the application of this function.

		R.insertAll(2, {'x','y','z'}, {1,2,3,4}) --> {1,2,'x','y','z',3,4}

				R.intersection

					Array

Added in v0.1.0

[*] -> [*] -> [*]

	Combines two lists into a set (i.e. no duplicates) composed of those	elements common to both lists.

see R.innerJoin

		R.intersection({1,2,3,4}, {7,6,5,4,3}) --> {3, 4}

				R.intersperse

					Array

Added in v0.1.0

a -> [a] -> [a]

	Creates a new list with the separator interposed between elements.

		R.intersperse('n', {'ba', 'a', 'a'}) --> {'ba', 'n', 'a', 'n', 'a'}

				R.last

					Array

Added in v0.1.0

String -> String

	Returns the last element of the given list or string.

see R.init,R.head,R.tail

		R.last({'fi', 'fo', 'fum'}) --> 'fum'
		R.last({}) --> nil
		R.last('abc') --> 'c'
		R.last('') --> ''

				R.lastIndexOf

					Array

Added in v0.1.0

a -> [a] -> Number

	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.

see R.indexOf

		R.lastIndexOf(3, {-1,3,3,0,1,2,3,4}) --> 7
		R.lastIndexOf(10, {1,2,3,4}) --> -1

				R.length

					Array

Added in v0.1.0

[a] -> Number

	Returns the number of elements in the table.

		R.length({}) --> 0
		R.length({1, 2, 3}) --> 3

				R.none

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> Boolean

	Returns `true` if no elements of the list match the predicate, `false`	otherwise.		Dispatches to the `any` method of the second argument, if present.

see R.all,R.any

		local isEven = n => n % 2 === 0

		R.none(isEven, {1, 3, 5, 7, 9, 11}) --> true
		R.none(isEven, {1, 3, 5, 7, 8, 11}) --> false

				R.nth

					Array

Added in v0.1.0

Number -> String -> String

	Returns the nth element of the given list or string. If n is negative the	element at index length + n is returned.

		local list = {'foo', 'bar', 'baz', 'quux'}
		R.nth(1, list) --> 'bar'
		R.nth(-1, list) --> 'quux'
		R.nth(-99, list) --> nil
		R.nth(2, 'abc') --> 'c'
		R.nth(3, 'abc') --> ''

				R.pair

					Array

Added in v0.1.0

a -> b -> (a,b)

	Takes two arguments, `fst` and `snd`, and returns `{fst, snd}`.

see R.objOf,R.of

		R.pair('foo', 'bar') --> {'foo', 'bar'}

				R.partition

					Array

Added in v0.1.0

Filterable f => (a -> Boolean) -> f a -> [f a, f a]

	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`.

see R.filter,R.reject

		R.partition(R.contains('s'), {'sss', 'ttt', 'foo', 'bars'}) --> {{'sss', 'bars'}, {'ttt', 'foo' }}
		R.partition(R.contains('s'), {a = 'sss', b = 'ttt', foo = 'bars'}) --> {{ a = 'sss', foo = 'bars' }, { b = 'ttt' }}

				R.pluck

					Array

Added in v0.1.0

Functor f => k -> f {k: v} -> f v

	Returns a new list by plucking the same named property off all objects in	the list supplied.

see R.props

		R.pluck('a')({{a = 1}, {a = 2}}) --> {1, 2}
		R.pluck(0)({{1, 2}, {3, 4}}) --> {1, 3}
		R.pluck('val', {a = {val = 3}, b = {val = 5}}) --> {a = 3, b = 5}

				R.prepend

					Array

Added in v0.1.0

a -> [a] -> [a]

	Returns a new list with the given element at the front, followed by the	contents of the list.

see R.append

		R.prepend('fee', {'fi', 'fo', 'fum'}) --> {'fee', 'fi', 'fo', 'fum'}

				R.push

					Array

Added in v0.1.0

Alias To R.append

				R.range

					Array

Added in v0.1.0

Number -> Number -> [Number]

	Returns a list of numbers from `from` (inclusive) to `to` (exclusive).

		R.range(1, 5)    --> {1, 2, 3, 4}
		R.range(50, 53)  --> {50, 51, 52}

				R.reduce

					Array

Added in v0.1.0

((a, b) -> a) -> a -> [b] -> a

	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.		The iterator function receives two values: *(acc, value)*. 		The arguments' order of [`reduceRight`](#reduceRight)'s iterator function	is *(value, acc)*.

see R.reduceRight

		R.reduce(R.subtract, 0, {1, 2, 3, 4}) --> ((((0 - 1) - 2) - 3) - 4) = -10
		--          -               -10
		--         / \              / \
		--        -   4           -6   4
		--       / \              / \
		--      -   3   ==>     -3   3
		--     / \              / \
		--    -   2           -1   2
		--   / \              / \
		--  0   1            0   1

				R.reduceBy

					Array

Added in v0.1.0

((a, b) -> a) -> a -> (b -> String) -> [b] -> {String: a}

	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`.		This function is basically a more general [`groupBy`](#groupBy) function.

see R.groupBy,R.reduce

		local reduceToNamesBy = R.reduceBy(function(acc, student)
			return R.append(student.name, acc)
		end, {})
		local namesByGrade = reduceToNamesBy(function(student)
			local score = student.score
			return score < 65 and 'F' or
					score < 70 and 'D' or
					score < 80 and 'C' or
					score < 90 and 'B' or 'A'
		end)
		local students = {{name = 'Lucy', score = 92},
						{name = 'Drew', score = 85},
						{name = 'Leo', score = 90},
						{name = 'Bart', score = 62}}
		namesByGrade(students) --> {A={"Lucy", "Leo"}, B={"Drew"}, F={"Bart"}}

				R.reduceWhile

					Array

Added in v0.1.0

((a, b) -> Boolean) -> ((a, b) -> a) -> a -> [b] -> a

	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.

see R.reduce

		local isOdd = R.o(R.equals(1), R.mod)
		local xs = {1, 3, 5, 60, 777, 800}
		R.reduceWhile(isOdd, R.add, 0, xs) --> 9

		local ys = {2, 4, 6}
		R.reduceWhile(isOdd, R.add, 111, ys) --> 111

				R.reject

					Array

Added in v0.1.0

Filterable f => (a -> Boolean) -> f a -> f a

	The complement of [`filter`](#filter).

see R.filter

		local isOdd = R.o(R.equals(1), R.mod(R.__, 2))
		R.reject(isOdd, {1, 2, 3, 4}) --> {2, 4}
		R.reject(isOdd, {a = 1, b = 2, c = 3, d = 4}) --> {b = 2, d = 4}

				R.remove

					Array

Added in v0.1.0

Number -> Number -> [a] -> [a]

	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.	No lists have been harmed in the application of this function.

		R.remove(2, 3, {1,2,3,4,5,6,7,8}) --> {1,2,6,7,8}

				R.repeat_

					Array

Added in v0.1.0

a -> n -> [a]

	Returns a fixed list of size `n` containing a specified identical value.

see R.times

		R.repeat_('hi', 5) --> {'hi', 'hi', 'hi', 'hi', 'hi'}
		local obj = {}
		local repeatedObjs = R.repeat_(obj, 5) --> {{}, {}, {}, {}, {}}
		R.same(repeatedObjs[1], repeatedObjs[2]) --> true

				R.reverse

					Array

Added in v0.1.0

String -> String

	Returns a new list or string with the elements or characters in reverse	order.

		R.reverse({1, 2, 3})  --> {3, 2, 1}
		R.reverse({1, 2})     --> {2, 1}
		R.reverse({1})        --> {1}
		R.reverse({})         --> {}

		R.reverse('abc')      --> 'cba'
		R.reverse('ab')       --> 'ba'
		R.reverse('a')        --> 'a'
		R.reverse('')         --> ''

				R.scan

					Array

Added in v0.1.0

(a,b -> a) -> a -> [b] -> [a]

	Scan is similar to [`reduce`](#reduce), but returns a list of successively	reduced values from the left

see R.reduce

		local numbers = {1, 2, 3, 4}
		local factorials = R.scan(R.multiply, 1, numbers) --> {1, 1, 2, 6, 24}

				R.size

					Array

Added in v0.1.0

Alias To R.length

				R.slice

					Array

Added in v0.1.0

Number -> Number -> String -> String

	Returns the elements of the given list or string from `fromIndex` (inclusive) to `toIndex` (exclusive).		if `fromIndex` is zero then it will set to 1(from the first element)	if `toIndex` is zero then it will set to length + 1(include the last element)	negative number is the index from right side	-1 means the last element, etc..

		R.slice(2, 3, {'a', 'b', 'c', 'd'})        --> {'b'}
		R.slice(1, -2, {'a', 'b', 'c', 'd'})       --> {'a', 'b'}
		R.slice(-3, -1, {'a', 'b', 'c', 'd'})      --> {'b', 'c'}
		R.slice(1, 3, 'lamda')                     --> 'la'

				R.sort

					Array

Added in v0.1.0

(a,a -> Number) -> [a] -> [a]

	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.

		local diff = R.lt
		R.sort(diff, {4,2,7,5}) --> {2, 4, 5, 7}

				R.sortWith

					Array

Added in v0.1.0

[a -> a -> Number] -> [a] -> [a]

	Sorts a list according to a list of comparators.

		local alice = {
			name = 'alice',
			age = 40
		}
		local bob = {
			name = 'bob',
			age = 30
		}
		local clara = {
			name = 'clara',
			age = 40
		}
		local people = {clara, bob, alice}
		local ageNameSort = R.sortWith({
			R.descend(R.prop('age')),
			R.ascend(R.prop('name'))
		})
		ageNameSort(people) --> {alice, clara, bob}

				R.splitAt

					Array

Added in v0.1.0

Number -> String -> [String, String]

	Splits a given list or string at a given index.

		R.splitAt(2, {1, 2, 3})          --> {{1}, {2, 3}}
		R.splitAt(6, 'hello world')      --> {'hello', ' world'}
		R.splitAt(-1, 'foobar')          --> {'fooba', 'r'}

				R.splitEvery

					Array

Added in v0.1.0

Number -> String -> [String]

	Splits a collection into slices of the specified length.

		R.splitEvery(3, {1, 2, 3, 4, 5, 6, 7}) --> {{1, 2, 3}, {4, 5, 6}, {7}}
		R.splitEvery(3, 'foobarbaz') --> {'foo', 'bar', 'baz'}

				R.splitWhen

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> [ [a], [a] ]

	Takes a list and a predicate and returns a pair of lists with the following properties:		The result of concatenating the two output lists is equivalent to the input list	none of the elements of the first output list satisfies the predicate and	if the second output list is non-empty, its first element satisfies the predicate.

		R.splitWhen(R.equals(2), {1, 2, 3, 1, 2, 3})   --> {{1}, {2, 3, 1, 2, 3}}

				R.tail

					Array

Added in v0.1.0

String -> String

	Returns all but the first element of the given list or string (or object	with a `tail` method).
	Dispatches to the `slice` method of the first argument, if present.

see R.head,R.init,R.last

		R.tail({1, 2, 3})  --> {2, 3}
		R.tail({1, 2})     --> {2}
		R.tail({1})        --> {}
		R.tail({})         --> {}

		R.tail('abc')  --> 'bc'
		R.tail('ab')   --> 'b'
		R.tail('a')    --> ''
		R.tail('')     --> ''

				R.take

					Array

Added in v0.1.0

Number -> String -> String

	Returns the first `n` elements of the given list, string

see R.drop

		R.take(1, {'foo', 'bar', 'baz'}) --> {'foo'}
		R.take(2, {'foo', 'bar', 'baz'}) --> {'foo', 'bar'}
		R.take(3, {'foo', 'bar', 'baz'}) --> {'foo', 'bar', 'baz'}
		R.take(4, {'foo', 'bar', 'baz'}) --> {'foo', 'bar', 'baz'}
		R.take(3, 'ramda')               --> 'ram'

		local personnel = {
			'Dave Brubeck',
			'Paul Desmond',
			'Eugene Wright',
			'Joe Morello',
			'Gerry Mulligan',
			'Bob Bates',
			'Joe Dodge',
			'Ron Crotty'
		}
		local takeFive = R.take(5)
		takeFive(personnel) --> {'Dave Brubeck', 'Paul Desmond', 'Eugene Wright', 'Joe Morello', 'Gerry Mulligan'}

				R.takeLast

					Array

Added in v0.1.0

Number -> String -> String

	Returns a new list containing the last `n` elements of the given list.	If `n > #list`, returns a list of `#list` elements.

see R.dropLast

		R.takeLast(1, {'foo', 'bar', 'baz'}) --> {'baz'}
		R.takeLast(2, {'foo', 'bar', 'baz'}) --> {'bar', 'baz'}
		R.takeLast(3, {'foo', 'bar', 'baz'}) --> {'foo', 'bar', 'baz'}
		R.takeLast(4, {'foo', 'bar', 'baz'}) --> {'foo', 'bar', 'baz'}
		R.takeLast(3, 'lamda')               --> 'mda'

				R.takeLastWhile

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> [a]

	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)*.

see R.dropLastWhile

		local isNotOne = R.complement(R.equals(1))
		R.takeLastWhile(isNotOne, {1, 2, 3, 4}) --> {2, 3, 4}

				R.takeWhile

					Array

Added in v0.1.0

(a -> Boolean) -> [a] -> [a]

	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)*.

see R.dropWhile

		local isNotFour = R.complement(R.equals(4))
		R.takeWhile(isNotFour, {1, 2, 3, 4, 3, 2, 1}) --> {1, 2, 3}

				R.times

					Array

Added in v0.1.0

(Number -> a) -> Number -> [a]

	Calls an input function `n` times, returning an array containing the results	of those function calls.		`fn` is passed one argument: The current value of `n`, which begins at `1`	and is gradually incremented to `n`.

see R.repeat

		R.times(R.identity, 5) --> {1, 2, 3, 4, 5}

				R.transpose

					Array

Added in v0.1.0

[ [a] ] -> [ [a] ]

	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`.

		R.transpose({{1, 'a'}, {2, 'b'}, {3, 'c'}}) --> {{1, 2, 3}, {"a", "b", "c"}}
		R.transpose({{1, 2, 3}, {'a', 'b', 'c'}}) --> {{1, "a"}, {2, "b"}, {3, "c"}}

		-- If some of the rows are shorter than the following rows, their elements are skipped:
		R.transpose({{10, 11}, {20}, {}, {30, 31, 32}}) --> {{10, 20, 30}, {11, 31}, {32}}

				R.unfold

					Array

Added in v0.1.0

(a -> [b]) -> * -> [b]

	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.		The iterator function receives one argument: *(seed)*.

		local f = function(n)
			if n > 50 then return false end
			return {-n, n + 10}
		end
		R.unfold(f, 10) --> {-10, -20, -30, -40, -50}

				R.union

					Array

Added in v0.1.0

[*] -> [*] -> [*]

	Combines two lists into a set (i.e. no duplicates) composed of the elements	of each list.

		R.union({1, 2, 3}, {2, 3, 4}) --> {1, 2, 3, 4}

				R.unionWith

					Array

Added in v0.1.0

(a -> a -> Boolean) -> [*] -> [*] -> [*]

	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.

see R.union

		local l1 = {{a = 1}, {a = 2}}
		local l2 = {{a = 1}, {a = 4}}
		R.unionWith(R.eqBy(R.prop('a')), l1, l2) --> {{a = 1}, {a = 2}, {a = 4}}

				R.uniq

					Array

Added in v0.1.0

[a] -> [a]

	Returns a new list containing only one copy of each element in the original	list. [`R.equals`](#equals) is used to determine equality.		@funn

		R.uniq({1, 1, 2, 1}) --> {1, 2}
		R.uniq({1, '1'})     --> {1, '1'}
		R.uniq({{42}, {42}}) --> {{42}}

				R.uniqBy

					Array

Added in v0.1.0

(a -> b) -> [a] -> [a]

	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.

		R.uniqBy(math.abs, {-1, -5, 2, 10, 1, 2}) --> {-1, -5, 2, 10}

				R.uniqWith

					Array

Added in v0.1.0

(a, a -> Boolean) -> [a] -> [a]

	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.

		local strEq = R.eqBy(String)
		R.uniqWith(strEq)([1, '1', 2, 1]) --> [1, 2]
		R.uniqWith(strEq)([{}, {}])       --> [{}]
		R.uniqWith(strEq)([1, '1', 1])    --> [1]
		R.uniqWith(strEq)(['1', 1, 1])    --> ['1']

				R.unnest

					Array

Added in v0.1.0

Chain c => c (c a) -> c a

	Shorthand for `R.chain(R.identity)`, which removes one level of nesting from	any [Chain](https:--github.com/fantasyland/fantasy-land#chain).

see R.flatten,R.chain

		R.unnest({1, {2}, {{3}}}) --> {1, 2, {3}}
		R.unnest({{1, 2}, {3, 4}, {5, 6}}) --> {1, 2, 3, 4, 5, 6}

				R.unshift

					Array

Added in v0.1.0

Alias To R.prepend

				R.update

					Array

Added in v0.1.0

Number -> a -> [a] -> [a]

	Returns a new copy of the array with the element at the provided index	replaced with the given value.

see R.adjust

		R.update(2, 11, {0, 1, 2})     --> {0, 11, 2}
		R.update(2)(11)({0, 1, 2})     --> {0, 11, 2}

				R.without

					Array

Added in v0.1.0

[a] -> [a] -> [a]

	Returns a new list without values in the first argument.	[`R.equals`](#equals) is used to determine equality.

see R.difference

		R.without({1, 2}, {1, 2, 1, 3, 4}) --> {3, 4}

				R.xprod

					Array

Added in v0.1.0

[a] -> [b] -> [ [a,b] ]

	Creates a new list out of the two supplied by creating each possible pair	from the lists.

		R.xprod({1, 2}, {'a', 'b'}) --> {{1, 'a'}, {1, 'b'}, {2, 'a'}, {2, 'b'}}

				R.zip

					Array

Added in v0.1.0

[a] -> [b] -> [ [a,b] ]

	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} end)`.

		R.zip({1, 2, 3}, {'a', 'b', 'c'}) --> {{1, 'a'}, {2, 'b'}, {3, 'c'}}

				R.zipObj

					Array

Added in v0.1.0

[String] -> [*] -> {String: *}

	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)`.

		R.zipObj({'a', 'b', 'c'}, {1, 2, 3}) --> {a = 1, b = 2, c = 3}

				R.zipWith

					Array

Added in v0.1.0

(a,b -> c) -> [a] -> [b] -> [c]

	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.

		local f = function(x, y)
			-- ...
		end
		R.zipWith(f, {1, 2, 3}, {'a', 'b', 'c'})
		--> {f(1, 'a'), f(2, 'b'), f(3, 'c')}

				R.F

					Functional

Added in v0.1.0

* -> Boolean

	A function that always returns `false`. Any passed in parameters are ignored.

see R.always,R.T

		R.F()  --> false

				R.T

					Functional

Added in v0.1.0

* -> Boolean

	A function that always returns `true`. Any passed in parameters are ignored.

see R.always,R.F

		R.T()  --> true

				R.allPass

					Functional

Added in v0.1.0
Not Curried

(*... -> Boolean) -> ... -> (*... -> Boolean)

	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.

see R.anyPass

		local isQueen = R.propEq('rank', 'Q')
		local isSpade = R.propEq('suit', '♠')
		local isQueenOfSpades = R.allPass(isQueen, isSpade)

		isQueenOfSpades({rank = 'Q', suit = '♣'}) --> false
		isQueenOfSpades({rank = 'Q', suit = '♠'}) --> true

				R.always

					Functional

Added in v0.1.0

a -> (* -> a)

	Returns a function that always returns the given value. Note that for	non-primitives the value returned is a reference to the original value.		This function is known as `const`, `constant`, or `K` (for K combinator) in	other languages and libraries.

		local t = R.always('Tee')
		t() --> 'Tee'

				R.and_

					Functional

Added in v0.1.0

a -> b -> a | b

	Returns `true` if both arguments are `true` `false` otherwise.

see R.both

		R.and(true, true) --> true
		R.and(true, false) --> false
		R.and(false, true) --> false
		R.and(false, false) --> false

				R.anyPass

					Functional

Added in v0.1.0

(*... -> Boolean) -> ... -> (*... -> Boolean)

	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.

see R.allPass

		local isClub = R.propEq('suit', '♣')
		local isSpade = R.propEq('suit', '♠')
		local isBlackCard = R.anyPass(isClub, isSpade)

		isBlackCard({rank = '10', suit ='♣'}) --> true
		isBlackCard({rank = 'Q', suit = '♠'}) --> true
		isBlackCard({rank = 'Q', suit = '♦'}) --> false

				R.apply

					Functional

Added in v0.1.0

(*... -> a) -> [*] -> a

	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.

see R.unapply

		local nums = {1, 2, 3, -99, 42, 6, 7}
		R.apply(math.max, nums) --> 42

				R.ascend

					Functional

Added in v0.1.0

Ord b => (a -> b) -> a -> a -> Number

	Makes an ascending comparator function out of a function that returns a value	that can be compared with `<` and `>`.

see R.descend

		local byAge = R.ascend(R.prop('age'))
		local people = {
			{ name = 'Emma', age = 70 },
			{ name = 'Peter', age = 78 },
			{ name = 'Mikhail', age = 62 },
		}
		local peopleByYoungestFirst = R.sort(byAge, people) --> {{ name = 'Mikhail', age: 62 },{ name = 'Emma', age: 70 }, { name = 'Peter', age: 78 }}

				R.binary

					Functional

Added in v0.1.0

(* -> c) -> (a, b -> c)

	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.

see R.nAry,R.unary

		local takesThreeArgs = function(a, b, c)
			return {a, b, c}
		end
		takesThreeArgs(1, 2, 3) --> {1, 2, 3}

		local takesTwoArgs = R.binary(takesThreeArgs)
		-- Only 2 arguments are passed to the wrapped function
		takesTwoArgs(1, 2, 3) --> {1, 2}

				R.bind

					Functional

Added in v0.1.0

(* -> *) -> {*} -> (* -> *)

	Creates a function that is bound to a context.

see R.partial

		local str = "test hello world" --> length 16
		local strlen = R.bind(string.len, str)
		R.map(strlen, R.split(",", "123,4,56789")) --> {16, 16, 16}

				R.both

					Functional

Added in v0.1.0

(*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)

	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.

see R.and

		local gt10 = R.gt(R.__, 10)
		local lt20 = R.lt(R.__, 20)
		local f = R.both(gt10, lt20)
		f(15) --> true
		f(30) --> false

				R.call

					Functional

Added in v0.1.0

(*... -> a),*... -> a

	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.

see R.apply

		R.call(R.add, 1, 2) --> 3

				R.comparator

					Functional

Added in v0.1.0

(a, b -> Boolean) -> (a, b -> Number)

	Makes a comparator function out of a function that reports whether the first	element is less than the second.

see R.ascend,R.desend

		local byAge = R.comparator(function(a, b) return a.age < b.age end)
		local people = {
			-- ...
		}
		local peopleByIncreasingAge = R.sort(byAge, people)

				R.complement

					Functional

Added in v0.1.0

(*... -> *) -> (*... -> Boolean)

	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`.

see R.not

		local isNotNil = R.complement(R.isNil)
		R.isNil(nil) --> true
		isNotNil(nil) --> false
		R.isNil(7) --> false
		isNotNil(7) --> true

				R.compose

					Functional

Added in v0.1.0
Not Curried

((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)

	Performs right-to-left function composition. The rightmost function may have	any arity the remaining functions must be unary.		*Note:** The result of compose is not automatically curried.

see R.pipe

		local classyGreeting = function(firstName, lastName)
			return "The name's " + lastName + ", " + firstName + " " + lastName
		end
		local yellGreeting = R.compose(R.toUpper, classyGreeting)
		yellGreeting('James', 'Bond') --> "THE NAME'S BOND, JAMES BOND"

		R.compose(math.abs, R.add(1), R.multiply(2))(-4) --> 7

				R.cond

					Functional

Added in v0.1.0

[ [(*... -> Boolean),(*... -> *)] ] -> (*... -> *)

	Returns a function, `fn`, which encapsulates `if/else, if/else, ...` logic.	`R.cond` takes a list of predicate 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 nil.

		local fn = R.cond({
			{R.equals(0),   R.always('water freezes at 0°C')},
			{R.equals(100), R.always('water boils at 100°C')},
			{R.T,           function(temp) return 'nothing special happens at ' .. temp .. '°C' end}
		})
		fn(0) --> 'water freezes at 0°C'
		fn(50) --> 'nothing special happens at 50°C'
		fn(100) --> 'water boils at 100°C'

				R.converge

					Functional

Added in v0.1.0

(x1 -> x2 -> ... -> z) -> [(a -> b -> ... -> x1), (a -> b -> ... -> x2), ...] -> (a -> b -> ... -> z)

	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.

see R.useWith

		local average = R.converge(R.divide, {R.sum, R.length})
		average({1, 2, 3, 4, 5, 6, 7}) --> 4

		local strangeConcat = R.converge(R.concat, {R.toUpper, R.toLower})
		strangeConcat("Yodel") --> "YODELyodel"

				R.curry1

					Functional

Added in v0.1.0

Alias To R.curryN

	Special for curryN

				R.curry2

					Functional

Added in v0.1.0

Alias To R.curryN

	Special for curryN

				R.curry3

					Functional

Added in v0.1.0

Alias To R.curryN

	Special for curryN

				R.curryN

					Functional

Added in v0.1.0

Number -> (* -> a) -> (* -> a)

	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:		- `g(1)(2)(3)`	- `g(1)(2, 3)`	- `g(1, 2)(3)`	- `g(1, 2, 3)`		Secondly, the special placeholder value [`R.__`](#__) may be used to specify	"gaps", allowing partial application of any combination of arguments,	regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),	the following are equivalent:		- `g(1, 2, 3)`	- `g(_, 2, 3)(1)`	- `g(_, _, 3)(1)(2)`	- `g(_, _, 3)(1, 2)`	- `g(_, 2)(1)(3)`	- `g(_, 2)(1, 3)`	- `g(_, 2)(_, 3)(1)`

see R.curry

		local sumArgs = function(...) return R.sum({...}) end

		local curriedAddFourNumbers = R.curryN(4, sumArgs)
		local f = curriedAddFourNumbers(1, 2)
		local g = f(3)
		g(4) --> 10

				R.descend

					Functional

Added in v0.1.0

Ord b => (a -> b) -> a -> a -> Number

	Makes a descending comparator function out of a function that returns a value	that can be compared with `<` and `>`.

see R.ascend

		local byAge = R.descend(R.prop('age'))
		local people = {
			{ name = 'Emma', age = 70 },
			{ name = 'Peter', age = 78 },
			{ name = 'Mikhail', age = 62 },
		}
		local peopleByYoungestFirst = R.sort(byAge, people) --> {{ name = 'Peter', age: 78 }, { name = 'Emma', age: 70 }, { name = 'Mikhail', age: 62 }}

				R.either

					Functional

Added in v0.1.0

(*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)

	A function wrapping calls to the two functions in an `or` 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.

see R.or_

		local gt10 = function(x) return x > 10 end
		local even = function(x) return x % 2 == 0 end
		local f = R.either(gt10, even)
		f(101) --> true
		f(8) --> true

				R.flip

					Functional

Added in v0.1.0

(a -> b -> c -> ... -> z) -> (b -> a -> c -> ... -> z)

	Returns a new function much like the supplied one, except that the first two	arguments' order is reversed.

		local mergeThree = function(a, b, c) return a .. b .. c end
		mergeThree('1','2','3') --> "123"
		R.flip(mergeThree)('1','2','3') --> "213"

				R.identity

					Functional

Added in v0.1.0

a -> a

	A function that does nothing but return the parameter supplied to it. Good	as a default or placeholder function.

		R.identity(1) --> 1
		local obj = {}
		R.identity(obj) == obj --> true

				R.ifElse

					Functional

Added in v0.1.0

(*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)

	Creates a function that will process either the `onTrue` or the `onFalse`	function depending upon the result of the `condition` predicate.

see R.unless,R.when

		local incCount = R.ifElse(
			R.has('count'),
			R.assoc('count', 'null'),
			R.assoc('count', 1)
		)
		print(R.toString(incCount({})))            --> { count: 1 }
		print(R.toString(incCount({ count = 1 }))) --> { count = 'null' }

				R.juxt

					Functional

Added in v0.1.0

[(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])

	juxt applies a list of functions to a list of values.

see R.applySpec

		local getRange = R.juxt({math.min, math.max})
		getRange(3, 4, 9, -3) --> {-3, 9}

				R.map

					Functional

Added in v0.1.0

Functor f => (a -> b) -> f a -> f b

	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.		Lamda provides suitable `map` implementations for `Array` and `Object`,	so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.		Also treats functions as functors and will compose them together.

		local double = x => x * 2
		R.map(double, [1, 2, 3]) --> [2, 4, 6]
		R.map(double, {x: 1, y: 2, z: 3}) --> [2, 4, 6]

				R.mapAccum

					Functional

Added in v0.1.0

(acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])

	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.		The iterator function receives two arguments, *acc* and *value*, and should	return a tuple *[acc, value]*.

see R.mapAccumRight

		local digits = {'1', '2', '3', '4'}
		local appender = R.juxt({R.concat, R.concat})
		R.mapAccum(appender, 0, digits) --> {'01234', {'01', '012', '0123', '01234'} }

				R.mapAccumRight

					Functional

Added in v0.1.0

(x-> acc -> (y, acc)) -> acc -> [x] -> ([y], acc)

	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.		Similar to [`mapAccum`](#mapAccum), except moves through the input list from	the right to the left.		The iterator function receives two arguments, *value* and *acc*, and should	return a tuple *[value, acc]*.

see R.mapAccum

		local digits = {'1', '2', '3', '4'}
		local appender = R.juxt({R.concat, R.concat})
		R.mapAccumRight(append, 5, digits) --> {{'12345', '2345', '345', '45'}, '12345'}

				R.memoize

					Functional

Added in v0.1.0

(*... -> a) -> (*... -> a)

	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.

see R.memoizeWith

		local count = 0
		local factorial = R.memoize(function(n)
			count = count + 1
			return R.product(R.range(1, n + 1))
		end)
		factorial(5) --> 120
		factorial(5) --> 120
		factorial(5) --> 120
		count --> 1

				R.memoizeWith

					Functional

Added in v0.1.0

(*... -> String) -> (*... -> a) -> (*... -> a)

	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.

see R.memoize

		local count = 0
		local factorial = R.memoizeWith(R.identity, function(n)
			count = count + 1
			return R.product(R.range(1, n + 1))
		end)
		factorial(5) --> 120
		factorial(5) --> 120
		factorial(5) --> 120
		count --> 1

				R.mirror

					Functional

Added in v0.2.0

a -> [a]

	Takes a value, return an array with the value and it's clone value

		R.mirror(1) --> {1,1}
		R.mirror({}) --> {{},{}}

				R.mirrorBy

					Functional

Added in v0.2.0

(a -> * ) -> a -> [a, *]

	Takes a value, returns an array of this value and the result of this 	value being passed into the given function call.

		R.mirrorBy(R.id, 1) --> {1,1}
		R.mirrorBy(R.size, {1,2,3}) --> {{1,2,3}, 3}

				R.nAry

					Functional

Added in v0.1.0

Number -> (* -> a) -> (* -> a)

	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.	Max n is ten (error if greater than 10)

see R.binary,R.unary

		local takesTwoArgs = function (a, b, c, d)
			return {a, b, c, d}
		end
		takesTwoArgs(1, 2, 3, 4) --> {1, 2, 3, 4}

		local takesOneArg = R.nAry(3, takesTwoArgs)
		-- Only `n` arguments are passed to the wrapped function
		takesOneArg(1, 2, 3, 4) --> {1, 2, 3}

				R.not_

					Functional

Added in v0.1.0

* -> Boolean

	A function that returns the `not` of its argument. It will return `true` when	passed false-y value, and `false` when passed a truth-y one.

see R.complement

		R.not(true) --> false
		R.not(false) --> true
		R.not(0) --> false
		R.not(1) --> false

				R.o

					Functional

Added in v0.1.0

(b -> c) -> (a -> b) -> a -> c

	`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.

see R.compose,R.pipe

		local classyGreeting = function(name)
			return "The name's " + name.last + ", " + name.first + " " + lastName
		end
		local yellGreeting = R.o(R.toUpper, classyGreeting)
		yellGreeting({first = 'James', last = 'Bond'}) --> "THE NAME'S BOND, JAMES BOND"

		R.o(R.multiply(10), R.add(10))(-4) --> 60

				R.of

					Functional

Added in v0.1.0

a -> [a]

	Returns a singleton array containing the value provided.

		R.of(42) --> {42}
		R.of({42}) --> {{42}}

				R.once

					Functional

Added in v0.1.0

(a... -> b) -> (a... -> b)

	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.

		local addOneOnce = R.once(R.add(1))
		addOneOnce(10) --> 11
		addOneOnce(addOneOnce(50)) --> 11

				R.or_

					Functional

Added in v0.1.0

a -> b -> a | b

	Returns `true` if one or both of its arguments are `true`. Returns `false`	if both arguments are `false`.

see R.either

		R.or(true, true) --> true
		R.or(true, false) --> true
		R.or(false, true) --> true
		R.or(false, false) --> false

				R.partial

					Functional

Added in v0.1.0

((a, b, c, ..., n) -> x) -> a, b, c -> ((d, e, f, ..., n) -> x)

	Takes a function `f` and the left 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`.

see R.partialRight

		local double = R.partial(R.multiply, 2)
		double(2) --> 4

		local greet = function (salutation, title, firstName, lastName)
			return salutation .. ', ' .. title .. ' ' .. firstName .. ' ' .. lastName .. '!'
		end

		local sayHello = R.partial(greet, 'Hello')
		local sayHelloToMs = R.partial(sayHello, 'Ms.')
		sayHelloToMs('Jane', 'Jones') --> 'Hello, Ms. Jane Jones!'

				R.partialRight

					Functional

Added in v0.1.0

((a, b, c, ..., n) -> x) -> d, e, f, ..., n -> ((a, b, c, ...) -> x)

	Takes a function `f` and the left 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.

see R.partial

		local greet = function (salutation, title, firstName, lastName)
			return salutation .. ', ' .. title .. ' ' .. firstName .. ' ' .. lastName .. '!'
		end
		local greetMsJaneJones = R.partialRight(greet, 'Ms.', 'Jane', 'Jones')
		greetMsJaneJones('Hello') --> 'Hello, Ms. Jane Jones!'

				R.pipe

					Functional

Added in v0.1.0
Not Curried

(((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z)

	Performs left-to-right function composition. The leftmost function may have	any arity the remaining functions must be unary.		In some libraries this function is named `sequence`.		*Note:** The result of pipe is not automatically curried.

see R.compose

		local f = R.pipe(Math.pow, R.negate, R.inc)
		f(3, 4) --> -(3^4) + 1

				R.tap

					Functional

Added in v0.1.0

(a -> *) -> a -> a

	Runs the given function with the supplied object, then returns the object.

		R.tap(R.partial(R.show, "x is "), 100) --> 100
		-->> "x is "100

				R.tryCatch

					Functional

Added in v0.1.0
Not Curried

(...x -> a) [-> ((e, ...x) -> a) -> (...x -> a)] -> (...x -> a)

/**	`tryCatch` takes three functions, a `tryer`, a `catcher` and a finaller . 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. 	If the finaller is not nil, then the function always return the finaller's results.

		R.tryCatch(R.prop('x'), R.F)({x = true}) 	--> true
		R.tryCatch(R.prop('x'), R.F)(1)      		--> false

				R.unapply

					Functional

Added in v0.1.0

([*...] -> a) -> (*... -> a)

	Takes a function `fn`, which takes a single array argument, and returns a	function which:			- takes any number of positional arguments		- passes these arguments to `fn` as an array and		- returns the result.		In other words, `R.unapply` derives a variadic function from a function which	takes an array. `R.unapply` is the inverse of [`R.apply`](#apply).

see R.apply

		R.unapply(R.sum)(1, 2, 3) --> 6

				R.unary

					Functional

Added in v0.1.0

(* -> b) -> (a -> b)

	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.

see R.binary,R.nAry

		local takesTwoArgs = function(a, b) {
			return {a, b}
		}
		takesTwoArgs(1, 2) --> {1, 2}

		local takesOneArg = R.unary(takesTwoArgs)
		-- Only 1 argument is passed to the wrapped function
		takesOneArg(1, 2) --> {1}

				R.unless

					Functional

Added in v0.1.0

(a -> Boolean) -> (a -> a) -> a -> a

	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.

see R.ifElse,R.when

		local safeInc = R.unless(R.isString, R.inc)
		safeInc('a') -->'a'
		safeInc(1) --> 2
end

				R.until_

					Functional

Added in v0.1.0

(a -> Boolean) -> (a -> a) -> a -> a

	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.

		R.until_(R.gt(R.__, 100), R.multiply(2))(1) --> 128

				R.useWith

					Functional

Added in v0.1.0

(x1 -> x2 -> ... -> z) -> [(a -> x1), (b -> x2), ...] -> (a -> b -> ... -> z)

	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.		If more arguments are passed to the returned function than transformer	functions, those arguments are passed directly to `fn` as additional	parameters. If you expect additional arguments that don't need to be	transformed, although you can ignore them, it's best to pass an identity	function so that the new function reports the correct arity.

see R.converge

		R.useWith(math.pow, {R.identity, R.identity})(3, 4) --> 81
		R.useWith(math.pow, {R.identity, R.identity})(3)(4) --> 81
		R.useWith(math.pow, {R.dec, R.inc})(3, 4) --> 32
		R.useWith(math.pow, {R.dec, R.inc})(3)(4) --> 32

				R.when

					Functional

Added in v0.1.0

(a -> Boolean) -> (a -> a) -> a -> a

	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.

see R.ifElse,R.unless

		-- truncate :: String -> String
		local truncate = R.when(
		R.compose(R.gt(R.__, 10), R.size),
		R.pipe(R.take(10), R.append('...'))
	)
	this.lu.assertEquals(truncate('12345'), '12345') --> '12345'
	this.lu.assertEquals(truncate('0123456789ABC'), '0123456789...') --> '0123456789…'

				R.abs

					Math

Added in vv0.2.0

number -> number

	Get the absolute value.

		R.abs(-5)       --> 5

				R.add

					Math

Added in v0.1.0

number -> number -> number

	Adds two values.

see R.subtract

		R.add(2, 3)       --> 5
		R.add(7)(10)      --> 17

				R.clamp

					Math

Added in v0.1.0

Ord a => a -> a -> a -> a

	Restricts a number to be within a range.		Also works for other ordered types such as strings

		R.clamp(1, 10, -5) --> 1
		R.clamp(1, 10, 15) --> 10
		R.clamp(1, 10, 4)  --> 4

				R.dec

					Math

Added in v0.1.0

Number -> Number

	Decrements its argument.

see R.inc

		R.dec(42) --> 41

				R.divide

					Math

Added in v0.1.0

Number -> Number -> Number

	Divides two numbers. Equivalent to `a / b`.

see R.multiply

		R.divide(71, 100) --> 0.71

		local half = R.divide(R.__, 2)
		half(42) --> 21

		local reciprocal = R.divide(1)
		reciprocal(4)   --> 0.25

				R.inc

					Math

Added in v0.1.0

Number -> Number

	Increments its argument.

see R.dec

		R.inc(42) --> 43

				R.mean

					Math

Added in v0.1.0

[Number] -> Number

	Returns the mean of the given list of numbers.

see R.median

		R.mean({2, 7, 9}) --> 6
		R.mean({}) --> nan

				R.median

					Math

Added in v0.1.0

[Number] -> Number

	Returns the median of the given list of numbers.

see R.mean

		R.median({2, 9, 7}) --> 7
		R.median({7, 2, 10, 9}) --> 8
		R.median({}) --> nan

				R.minus

					Math

Added in v0.1.0

Alias To R.subtract

				R.mod

					Math

Added in v0.1.0

Number -> Number -> Number

	Divides the first parameter by the second and returns the remainder.

		R.mod(17, 3) --> 2

		local isOdd = R.mod(R.__, 2)
		isOdd(42) --> 0
		isOdd(21) --> 1

				R.multiply

					Math

Added in v0.1.0

Number -> Number -> Number

	Multiplies two numbers. Equivalent to `a * b` but curried.

see R.divide

		local double = R.multiply(2)
		local triple = R.multiply(3)
		double(3)       -->  6
		triple(4)       --> 12
		R.multiply(2, 5)  --> 10

				R.negate

					Math

Added in v0.1.0

Number -> Number

	Negates its argument.

		R.negate(42) --> -42

				R.plus

					Math

Added in v0.1.0

Alias To R.add

				R.product

					Math

Added in v0.1.0

[Number] -> Number

	Multiplies together all the elements of a list.

see R.reduce

		R.product({2,4,6,8,100,1}) --> 38400
		R.product({}) --> 1

				R.subtract

					Math

Added in v0.1.0

Number -> Number -> Number

	Subtracts its second argument from its first argument.

see R.add

		R.subtract(10, 8) --> 2

		local minus5 = R.subtract(R.__, 5)
		minus5(17) --> 12

		local complementaryAngle = R.subtract(90)
		complementaryAngle(30) --> 60
		complementaryAngle(72) --> 18

				R.sum

					Math

Added in v0.1.0

[Number] -> Number

	Adds together all the elements of a list.

see R.reduce

		R.sum({2,4,6,8,100,1}) --> 121

				R.clone

					Object

Added in v0.1.0

{*} -> {*}

	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		Dispatches to a `clone` method if present.

		local objects = {{}, {}, {}}
		local objectsClone = R.clone(objects)
		objects == objectsClone --> false
		objects[1] == objectsClone[1] --> false

				R.eqProps

					Object

Added in v0.1.0

k -> {k: v} -> {k: v} -> Boolean

	Reports whether two objects have the same value, in [`R.equals`](#equals)	terms, for the specified property. Useful as a curried predicate.

		local o1 = { a = 1, b = 2, c = 3, d = 4 }
		local o2 = { a = 10, b = 20, c = 3, d = 40 }
		R.eqProps('a', o1, o2) --> false
		R.eqProps('c', o1, o2) --> true

				R.filter

					Object

Added in v0.1.0

Filterable f => (a -> Boolean) -> f a -> f a

	Takes a predicate and an array, and returns a new array of the	same type containing the members of the given array which satisfy the	given predicate.

see R.reject

		local isEven = function(n) return n % 2 == 0 end
		R.filter(isEven, {1, 2, 3, 4}) --> {2, 4}
		R.filter(isEven, {a = 1, b = 2, c = 3, d = 4}) --> {b = 2, d = 4}

				R.forEach

					Object

Added in v0.1.0

(a -> *) -> [a] -> [a]

	Iterate over an input `list`, calling a provided function `fn` for each	element in the list.		`fn` receives one argument: *(value)*.

		local printXPlusFive = function(x) print(x + 5) end
		R.forEach(printXPlusFive, {1, 2, 3})
		--> 6
		--> 7
		--> 8

				R.fromPairs

					Object

Added in v0.1.0

{{k,v}} -> {k: v}

	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.

see R.toPairs,R.pair

		R.fromPairs({{'a', 1}, {'b', 2}, {'c', 3}}) --> {a = 1, b = 2, c = 3}

				R.has

					Object

Added in v0.1.0

s -> {s: x} -> Boolean

	Returns whether or not an object has an key with the specified name

		local hasName = R.has('name')
		hasName({name = 'alice'})   --> true
		hasName({name = 'bob'})     --> true
		hasName({})                --> false

		local point = {x = 0, y = 0}
		local pointHas = R.has(R.__, point)
		pointHas('x')  --> true
		pointHas('y')  --> true
		pointHas('z')  --> false

				R.invert

					Object

Added in v0.1.0

{s: x} -> {x: [ s, ... ]}

	Same as [`R.invertObj`](#invertObj), however this accounts for objects with	duplicate values by putting the values into an array.

see R.invertObj

		local raceResultsByFirstName = {
			first = 'alice',
			second = 'jake',
			third = 'alice',
		}
		R.invert(raceResultsByFirstName) --> { 'alice': {'first', 'third'}, 'jake':{'second'} }

				R.invertObj

					Object

Added in v0.1.0

{s: x} -> {x: s}

	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.

see R.invert

		local raceResults = {
			first = 'alice',
			second = 'jake'
		}
		R.invertObj(raceResults) --> { 'alice' = 'first', 'jake' = 'second' }

		-- Alternatively:
		local raceResults = {'alice', 'jake'}
		R.invertObj(raceResults) --> { alice = 1, jake = 2 }

				R.keys

					Object

Added in v0.1.0

{k: v} -> [k]

	Returns a list containing the names of all the key of the supplied object.

see R.values,R.sortedKeys

		R.keys({a = 1, b = 2, c = 3}) --> {'a', 'b', 'c'}

				R.merge

					Object

Added in v0.1.0

{k: v} -> {k: v} -> {k: v}

	Create a new object with the keys of the first object merged with	the keys of the second object. If a key exists in both objects,	the value from the second object will be used.

see R.mergeDeepRight,R.mergeWith,R.mergeWithKey

		R.merge({ 'name' = 'fred', 'age': 10 }, { 'age': 40 }) --> { 'name' = 'fred', 'age': 40 }
		local resetToDefault = R.merge(R.__, {x: 0})
		resetToDefault({x: 5, y: 2}) --> {x: 0, y: 2}

				R.mergeAll

					Object

Added in v0.1.0

[{k: v}] -> {k: v}

	Merges a list of objects together into one object.

see R.reduce

		R.mergeAll({{foo = 1},{bar = 2},{baz = 3}}) --> {foo:1,bar:2,baz:3}
		R.mergeAll({{foo = 1},{foo = 2},{baz = 3}}) --> {foo:2,bar:2}

				R.mergeDeepLeft

					Object

Added in v0.1.0

{a} -> {a} -> {a}

	Creates a new object with the keys of the first object merged with	the keys 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.

see R.merge,R.mergeDeepRight,R.mergeDeepWith,R.mergeDeepWithKey

		R.mergeDeepLeft({ name = 'fred', age = 10, contact = { email = 'moo@example.com' }},
						{ age = 40, contact = { email = 'baa@example.com' }})
		--> {age=10, contact={email="moo@example.com"}, name="fred"}

				R.mergeDeepRight

					Object

Added in v0.1.0

{a} -> {a} -> {a}

	Creates a new object with the keys of the first object merged with	the keys 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.

see R.merge,R.mergeDeepLeft,R.mergeDeepWith,R.mergeDeepWithKey

		R.mergeDeepRight({ name = 'fred', age = 10, contact = { email = 'moo@example.com' }},
						{ age = 40, contact = { email = 'baa@example.com' }})
		--> {age=40, contact={email="baa@example.com"}, name="fred"}

				R.mergeDeepWith

					Object

Added in v0.1.0

(a -> a -> a) -> {a} -> {a} -> {a}

	Creates a new object with the keys 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.

see R.mergeWith,R.mergeDeep,R.mergeDeepWithKey

		v = R.mergeDeepWith(R.concat,
				{ a = true, c = { values = {10, 20} }},
				{ b = true, c = { values = {15, 35} }})
		--> {a=true, b=true, c={values={10, 20, 15, 35}}}

				R.mergeDeepWithKey

					Object

Added in v0.1.0

(String -> a -> a -> a) -> {a} -> {a} -> {a}

	Creates a new object with the keys 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.

see R.mergeWithKey,R.mergeDeep,R.mergeDeepWith

		local concatValues = function(k, l, r)
			return k == 'values' and R.concat(l, r) or r
		end
		R.mergeDeepWithKey(concatValues,
							{ a = true, c = { thing = 'foo', values = {10, 20} }},
							{ b = true, c = { thing = 'bar', values = {15, 35} }})
		--> {a=true, b=true, c={thing="bar", values={10, 20, 15, 35}}}

				R.mergeWith

					Object

Added in v0.1.0

(a -> a -> a) -> {a} -> {a} -> {a}

	Creates a new object with the keys 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.

see R.mergeDeepWith,R.merge,R.mergeWithKey

		R.mergeWith(R.concat,
			{ a = true, values = {10, 20} },
			{ b = true, values = {15, 35} })
		--> {a=true, b=true, values = {10, 20, 15, 35}}

				R.mergeWithKey

					Object

Added in v0.1.0

(String -> a -> a -> a) -> {a} -> {a} -> {a}

	Creates a new object with the keys 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.

see R.mergeDeepWithKey,R.merge,R.mergeWith

		local concatValues = function(k, l, r)
			return k == 'values' and R.concat(l, r) or r
		end
		v = R.mergeWithKey(concatValues,
			{ a = true, thing = 'foo', values = {10, 20} },
			{ b = true, thing = 'bar', values = {15, 35} })
		--> {a=true, b=true, thing="bar", values={10, 20, 15, 35}}

				R.objOf

					Object

Added in v0.1.0

String -> a -> {String:a}

	Creates an object containing a single key:value pair.

see R.pair

		local matchPhrases = R.compose(
			R.objOf('must'),
			R.map(R.objOf('match_phrase'))
		)
		matchPhrases({'foo', 'bar', 'baz'}) --> {must={{match_phrase="foo"}, {match_phrase="bar"}, {match_phrase="baz"}}}

				R.omit

					Object

Added in v0.1.0

[String] -> {String: *} -> {String: *}

	Returns a partial copy of an object omitting the keys specified.

see R.pick

		R.omit({'a', 'd'}, {a = 1, b = 2, c = 3, d = 4}) --> {b = 2, c = 3}

				R.path

					Object

Added in v0.1.0

[Idx] -> {a} -> a | nil

	Retrieve the value at a given path.

see R.prop

		R.path({'a', 'b'}, {a = {b = 2}}) --> 2
		R.path({'a', 'b'}, {c = {b = 2}}) --> nil

				R.pathEq

					Object

Added in v0.1.0

[Idx] -> a -> {a} -> Boolean

	Determines whether a nested path on an object has a specific value, in	[`R.equals`](#equals) terms. Most likely used to filter a list.

		local user1 = { address = { zipCode = 90210 } }
		local user2 = { address = { zipCode = 55555 } }
		local user3 = { name = 'Bob' }
		local users = { user1, user2, user3 }
		local isFamous = R.pathEq({'address', 'zipCode'}, 90210)
		R.filter(isFamous, users) --> {{address={zipCode=90210}}}

				R.pathOr

					Object

Added in v0.1.0

a -> [Idx] -> {a} -> a

	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.

		R.pathOr('N/A', {'a', 'b'}, {a = {b = 2}}) --> 2
		R.pathOr('N/A', {'a', 'b'}, {c = {b = 2}}) --> "N/A"

				R.pathSatisfies

					Object

Added in v0.1.0

(a -> Boolean) -> [Idx] -> {a} -> Boolean

	Returns `true` if the specified object property at given path satisfies the	given predicate `false` otherwise.

see R.propSatisfies,R.path

		R.pathSatisfies(y => y > 0, {'x', 'y'}, {x = {y = 2}}) --> true

				R.pick

					Object

Added in v0.1.0

[k] -> {k: v} -> {k: v}

	Returns a partial copy of an object containing only the keys specified. If	the key does not exist, the property is ignored.

see R.omit,R.props

		R.pick({'a', 'd'}, {a = 1, b = 2, c = 3, d = 4}) --> {a = 1, d = 4}
		R.pick({'a', 'e', 'f'}, {a = 1, b = 2, c = 3, d = 4}) --> {a = 1}

				R.pickAll

					Object

Added in vv0.2.0

[k] -> {k: v} -> {k: v}

	Similar to `pick` except that this one includes a `key: undefined` pair for	properties that don't exist.

see R.pick

		R.pickAll({'a', 'd'}, {a = 1, b = 2, c = 3, d = 4}) --> {a = 1, d = 4}
		R.pickAll({'a', 'e', 'f'}, {a = 1, b = 2, c = 3, d = 4}) --> {a = 1}

				R.pickBy

					Object

Added in v0.1.0

(v, k -> Boolean) -> {k: v} -> {k: v}

	Returns a partial copy of an object containing only the keys that satisfy	the supplied predicate.

see R.pick,R.filter

		local isUpperCase = R.compose(R.safeEquals, R.unpack, R.mirrorBy(R.toUpper), R.second)
		R.pickBy(isUpperCase, {a = 1, b = 2, A = 3, B = 4}) --> {A = 3, B = 4}

				R.prop

					Object

Added in v0.1.0

s -> {s: a} -> a | nil

	Returns a function that when supplied an object returns the indicated	property of that object, if it exists.

see R.path

		R.prop('x', {x = 100}) --> 100
		R.prop('x', {}) --> nil
		R.prop(1, {'a', 'b'}) --> 'a'
		R.prop(-9, {'a', 'b'}) --> nil

				R.propEq

					Object

Added in v0.1.0

String -> a -> Object -> Boolean

	Returns `true` if the specified object property is equal, in	[`R.equals`](#equals) terms, to the given value `false` otherwise.

see R.equals,R.propSatisfies

		local abby = {name = 'Abby', age = 7, hair = 'blond'}
		local fred = {name = 'Fred', age = 12, hair = 'brown'}
		local rusty = {name = 'Rusty', age = 10, hair = 'brown'}
		local alois = {name = 'Alois', age = 15, disposition = 'surly'}
		local kids = {abby, fred, rusty, alois}
		local hasBrownHair = R.propEq('hair', 'brown')
		R.filter(hasBrownHair, kids) --> {fred, rusty}

				R.propIs

					Object

Added in v0.1.0

Type -> String -> Object -> Boolean

	Returns `true` if the specified object property is of the given type	`false` otherwise.

see R.is,R.propSatisfies

		R.propIs(R.NUMBER, 'x', {x = 1, y = 2})  --> true
		R.propIs(R.NUMBER, 'x', {x = 'foo'})    --> false
		R.propIs(R.NUMBER, 'x', {})            --> false

				R.propOr

					Object

Added in v0.1.0

a -> String -> Object -> a

	If the given, non-null object has a key with the specified name,	returns the value of that property. Otherwise returns the provided default	value.

		local alice = {
			name = 'ALICE',
			age = 101
		}
		local favorite = R.prop('favoriteLibrary')
		local favoriteWithDefault = R.propOr('Lamda', 'favoriteLibrary')

		favorite(alice)  --> nil
		favoriteWithDefault(alice)  --> 'Lamda'

				R.propSatisfies

					Object

Added in v0.1.0

(a -> Boolean) -> String -> {String: a} -> Boolean

	Returns `true` if the specified object property satisfies the given	predicate `false` otherwise.

see R.propEq,R.propIs

		R.propSatisfies(R.lt(0), 'x', {x = 1, y = 2}) --> true

				R.props

					Object

Added in v0.1.0

[k] -> {k: v} -> [v]

	Acts as multiple `prop`: array of keys in, array of values out. Preserves	order.

		R.props({'x', 'y'}, {x = 1, y = 2}) --> {1, 2}
		R.props({'c', 'a', 'b'}, {b = 2, a = 1}) --> {nil, 1, 2}

		local fullName = R.compose(R.join(' '), R.props({'first', 'last'}))
		fullName({last = 'Bullet-Tooth', age = 33, first = 'Tony'}) --> 'Tony Bullet-Tooth'

				R.skeys

					Object

Added in v0.1.0

Alias To R.sortedKeys

				R.sortedKeys

					Object

Added in v0.1.0

{k: v} -> [k]

	Returns a sorted list containing the names of all the enumerable keys of	the supplied object.

see R.keys

		R.sortedKeys({a = 1, x = 2, c = 3}) --> {'a', 'b', 'x'}

				R.toPairs

					Object

Added in v0.1.0

{Key: *} -> [ [Key,*] ]

	Converts an object into an array of key, value arrays. 	Note that the order of the output array is not guaranteed.

see R.fromPairs

		R.toPairs({a = 1, b = 2, c = 3}) --> {{"a", 1}, {"c", 3}, {"b", 2}}

				R.values

					Object

Added in v0.1.0

{k: v} -> [v]

	Returns a list of all the enumerable keys of the supplied object.	Note that the order of the output array is not guaranteed across different	JS platforms.

see R.valuesIn,R.keys

		R.values({a: 1, b: 2, c: 3}) --> {1, 2, 3}

				R.where

					Object

Added in v0.1.0

{String: (* -> Boolean)} -> {String: *} -> Boolean

	Takes a spec object and a test object returns true if the test satisfies	the spec. Each of the spec's keys 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.		`where` is well suited to declaratively expressing constraints for other	functions such as [`filter`](#filter) and [`find`](#find).

		-- pred :: Object -> Boolean
		local pred = R.where({
			a = R.equals('foo'),
			b = R.complement(R.equals('bar')),
			x = R.gt(R.__, 10),
			y = R.lt(R.__, 20)
		})

		pred({a = 'foo', b = 'xxx', x = 11, y = 19}) --> true
		pred({a = 'xxx', b = 'xxx', x = 11, y = 19}) --> false
		pred({a = 'foo', b = 'bar', x = 11, y = 19}) --> false
		pred({a = 'foo', b = 'xxx', x = 10, y = 19}) --> false
		pred({a = 'foo', b = 'xxx', x = 11, y = 20}) --> false

				R.whereEq

					Object

Added in v0.1.0

{String: *} -> {String: *} -> Boolean

	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 keys, accessing that property of the object gives the same	value (in [`R.equals`](#equals) terms) as accessing that property of the	spec.		`whereEq` is a specialization of [`where`](#where).

see R.where

		-- pred :: Object -> Boolean
		local pred = R.whereEq({a = 1, b = 2})

		pred({a = 1})              --> false
		pred({a = 1, b = 2})        --> true
		pred({a = 1, b = 2, c = 3})  --> true
		pred({a = 1, b = 1})        --> false

				R.boxMullerSampling

					Random

Added in v0.1.0

Number a => a -> a -> a

	Normal stochastic algorithm | box muller algorithm	The algorithm generates a normal distributed random number with `mu` as the average and `sigma` as the standard deviation.

		R.boxMullerSampling(1, 1)

				R.choice

					Random

Added in v0.1.0

[a] -> a

	Return a random value from the given list.

		R.choice({1, 2, 3, 4, 5}) --> 2
		R.choice({1, 2, 3, 4, 5}) --> 4

				R.normalDistributed

					Random

Added in v0.1.0

Number a => a -> a -> a -> a

	Normal stochastic algorithm 	The algorithm generates a normal distributed random number with `min` `max` as the range and `sigma` as the standard deviation.	This algorithm based on box muller algorithm

		R.normalDistributed(0, 1, 0.7)

				R.randrange

					Random

Added in v0.1.0

Integer a -> a -> a

	Return a random value between `from`(inclusive) and `to`(inclusive) value

		R.randrange(1, 100) --> 31

				R.sample

					Random

Added in v0.1.0

[a] -> [a]

	Return some random values from the given list.

		R.sample(3, {1, 2, 3, 4, 5}) --> 1, 3, 5
		R.sample(1, {1, 2, 3, 4, 5}) --> 2

				R.shuffle

					Random

Added in v0.1.0

[a] -> [a]

	Return a shuffled list

		R.shuffle({1,2,3,4}) --> {4,1,3,2}

				R.endsWith

					String

Added in v0.1.0

String -> Boolean

	Checks if a list ends with the provided values

		R.endsWith('c', 'abc')                --> true
		R.endsWith('b', 'abc')                --> false
		R.endsWith({'c'}, {'a', 'b', 'c'})    --> true
		R.endsWith({'b'}, {'a', 'b', 'c'})    --> false

				R.indexOf

					String

Added in v0.1.0

a -> [a] -> Number

	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.

see R.findIndex,R.lastIndexOf

		R.indexOf(3, {1,2,3,4}) --> 3
		R.indexOf('e', "abcd")  --> -1

				R.join

					String

Added in v0.1.0

String -> [a] -> String

	Returns a string made by inserting the `separator` between each element and	concatenating all the elements into a single string.

see R.split

		local spacer = R.join(' ')
		spacer({'a', 2, 3.4})   --> 'a 2 3.4'
		R.join('|', {1, 2, 3})  --> '1|2|3'

				R.match

					String

Added in v0.1.0

String -> String -> [String | nil]

	Tests a regular expression against a String. Note that this function will	return an empty array when there are no matches.

see R.test

		R.match("[a-z]a", 'bananas') --> {"ba", "na", "na"}
		R.match("a", 'b') --> {}

				R.replace

					String

Added in v0.1.0

String|String -> String -> String -> String

	Replace a substring or regex match in a string with a replacement.

		R.replace('foo', 'bar', 1, 'foo foo foo') --> 'bar foo foo'
		R.replace('foo', 'bar', 0, 'foo foo foo') --> 'bar bar bar'

				R.split

					String

Added in v0.1.0

(String | String) -> String -> [String]

	Splits a string into an array of strings based on the given	separator.

see R.join

		local pathComponents = R.split('/')
		R.tail(pathComponents('/usr/local/bin')) --> {'usr', 'local', 'bin'}
		R.split('.', 'a.b.c.xyz.d') --> {'a', 'b', 'c', 'xyz', 'd'}

				R.startsWith

					String

Added in v0.1.0

String -> Boolean

	Checks if a list starts with the provided values

		R.startsWith('a', 'abc')                --> true
		R.startsWith('b', 'abc')                --> false
		R.startsWith({'a'}, {'a', 'b', 'c'})    --> true
		R.startsWith({'b'}, {'a', 'b', 'c'})    --> false

				R.strip

					String

Added in v0.1.0

Alias To R.trim

				R.test

					String

Added in v0.1.0

String -> String -> Boolean

	Determines whether a given string matches a given regular expression.

see R.match

		R.test("^x", 'xyz') --> true
		R.test("^y", 'xyz') --> false

				R.toLower

					String

Added in v0.1.0

String -> String

	The lower case version of a string.

see R.toUpper

		R.toLower('XYZ') --> 'xyz'

				R.toUpper

					String

Added in v0.1.0

String -> String

	The upper case version of a string.

see R.toLower

		R.toUpper('abc') --> 'ABC'

				R.trim

					String

Added in v0.1.0

String -> String

	Removes (strips) whitespace from both ends of the string.

		R.trim('   xyz  ') --> 'xyz'
		R.map(R.trim, R.split(',', 'x, y, z')) --> {'x', 'y', 'z'}

				R.count

					Util

Added in v0.1.0

a -> [a] -> Number

	Counts the given element of a list

		R.count(5, {1,2,5,5,3,2}) --> 2
		R.count('a', "hello world") --> 0

				R.countBy

					Util

Added in v0.1.0

(a -> String) -> [a] -> {*}

	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.

		local numbers = {1.0, 1.1, 1.2, 2.0, 3.0, 2.2}
		R.countBy(Math.floor)(numbers) --> {'1': 3, '2': 2, '3': 1}
		local letters = {'a', 'b', 'A', 'a', 'B', 'c'}
		R.countBy(R.toLower)(letters) --> {'a': 3, 'b': 2, 'c': 1}

				R.defaultTo

					Util

Added in v0.1.0
Not Curried

a -> b -> a | b

	Returns the second argument if it is not `nil` or `nan` or `inf`	otherwise the first argument is returned.

		R.defaultTo(42, nil) --> 42
		R.defaultTo(42, 0/0) --> 42
		R.defaultTo(42, 1/0) --> 42
		R.defaultTo(42, 100) --> 100

				R.empty

					Util

Added in v0.1.0

a -> a

	Returns the empty value of its argument's type. Lamda defines the empty	value of Table(`{}`), String (`''`), and Arguments.

		R.empty(3) --> 0
		R.empty(function() end)	--> nil
		R.empty({1, 2, 3}) --> {}
		R.empty('unicorns') --> ''
		R.empty({x = 1, y = 2}) --> {}
		R.empty(true) --> false

				R.eqBy

					Util

Added in v0.1.0

(a -> b) -> a -> a -> Boolean

	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.

		R.eqBy(math.abs, 5, -5) --> true

				R.equals

					Util

Added in v0.1.0

a -> b -> Boolean

	Returns `true` if its arguments are equivalent, `false` otherwise.

see R.same

		R.equals(1, 1) --> true
		R.equals(1, '1') --> false
		R.equals({1, 2, 3}, {1, 2, 3}) --> true

		local a = {}
		a.v = a
		local b = {}
		b.v = b
		R.equals(a, b) --> stack error , don't do this!

				R.first

					Util

Added in v0.1.0
Not Curried

a, *... -> a

    Returns the first argument.

		local t = R.first('a', 'b', 'c') --> 'a'
		local t = R.first()	--> nil

				R.gt

					Util

Added in v0.1.0

Ord a => a -> a -> Boolean

	Returns `true` if the first argument is greater than the second `false`	otherwise.

see R.lt

		R.gt(2, 1) --> true
		R.gt(2, 2) --> false
		R.gt(2, 3) --> false
		R.gt('a', 'z') --> false
		R.gt('z', 'a') --> true

				R.gte

					Util

Added in v0.1.0

Ord a => a -> a -> Boolean

	Returns `true` if the first argument is greater than or equal to the second	`false` otherwise.

see R.lte

		R.gte(2, 1) --> true
		R.gte(2, 2) --> true
		R.gte(2, 3) --> false
		R.gte('a', 'z') --> false
		R.gte('z', 'a') --> true

				R.is

					Util

Added in v0.1.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is an instance of the supplied constructor.

		R.is(R.TABLE, {}) --> true
		R.is(R.NUMBER, 1) --> true
		R.is(R.OBJECT, 1) --> false
		R.is(R.STRING, 's') --> true
		R.is(R.ARRAY, 's') --> false
		R.is(R.NUMBER, {}) --> false

				R.isArray

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is an array.

see R.is

				R.isBoolean

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is boolean.

see R.is

				R.isEmpty

					Util

Added in v0.1.0
Not Curried

a -> Boolean

	Returns `true` if the given value is its type's empty value `false`	otherwise.

		R.isEmpty({1, 2, 3})   --> false
		R.isEmpty({})          --> true
		R.isEmpty('')          --> true
		R.isEmpty(nil)        --> true
		R.isEmpty({})          --> true
		R.isEmpty({length = 0}) --> false

				R.isFunction

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is a function.

see R.is

				R.isInf

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is inf.

see R.is

				R.isInteger

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is an integer

see R.is

				R.isNan

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is nan.

see R.is

				R.isNil

					Util

Added in v0.1.0
Not Curried

* -> Boolean

	Checks if the input value is `nil`.

		R.isNil(nil) --> true
		R.isNil(0) --> false
		R.isNil(1/0) --> false
		R.isNil(0/0) --> false
		R.isNil([]) --> false

				R.isNull

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is empty value like `nil` `inf` `nan`.

see R.is

				R.isNumber

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is a number.

see R.is

				R.isObject

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is an object.

see R.is

				R.isSafeArray

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is an array.
	If val is nil, return false.

see R.is,R.isArray

				R.isSafeBoolean

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is boolean.
	If val is nil, return false.

see R.is,R.isBoolean

				R.isSafeFunction

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is a function.
	If val is nil, return false.

see R.is,R.isFunction

				R.isSafeInf

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is inf.
	If val is nil, return false.

see R.is,R.isInf

				R.isSafeInteger

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is an integer.
	If val is nil, return false.

see R.is,R.isInteger

				R.isSafeNan

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is nan.
	if val is nil, return false.

see R.is,R.isNan

				R.isSafeNumber

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is a number.
	If val is nil, return false.

see R.is,R.isNumber

				R.isSafeObject

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is an object.
	If val is nil, return false.

see R.is,R.isObject

				R.isSafeString

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is a string.
	If val is nil, return false.

see R.is,R.isString

				R.isSafeTable

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is a table.
	If val is nil, return false.

see R.is,R.isTable

				R.isSafeThread

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is a user data.
	If val is nil, return false.

see R.is,R.isThread

				R.isSafeUserData

					Util

Added in v0.2.0
Not Curried

(* -> {*}) -> a -> Boolean

	See if `val` is a user data.
	If val is nil, return false.

see R.is,R.isUserData

				R.isString

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is a string.

see R.is

				R.isTable

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is a table.

see R.is

				R.isThread

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is a thread.

see R.is

				R.isUserData

					Util

Added in v0.2.0

(* -> {*}) -> a -> Boolean

	See if `val` is a user data.

see R.is

				R.lt

					Util

Added in v0.1.0

Ord a => a -> a -> Boolean

	Returns `true` if the first argument is less than the second `false`	otherwise.

see R.gt

		R.lt(2, 1) --> false
		R.lt(2, 2) --> false
		R.lt(2, 3) --> true
		R.lt('a', 'z') --> true
		R.lt('z', 'a') --> false

				R.lte

					Util

Added in v0.1.0

Ord a => a -> a -> Boolean

	Returns `true` if the first argument is less than or equal to the second	`false` otherwise.

see R.gte

		R.lte(2, 1) --> false
		R.lte(2, 2) --> true
		R.lte(2, 3) --> true
		R.lte('a', 'z') --> true
		R.lte('z', 'a') --> false

				R.max

					Util

Added in v0.1.0

Ord a => a -> a -> a

	Returns the larger of its two arguments.

see R.maxBy,R.min

		R.max(789, 123) --> 789
		R.max('a', 'b') --> 'b'

				R.maxBy

					Util

Added in v0.1.0

Ord b => (a -> b) -> a -> a -> a

	Takes a function and two values, and returns whichever value produces the	larger result when passed to the provided function.

see R.max,R.minBy

		local square = function(x) return x*x end
		R.maxBy(square, -3, 2) --> -3
		R.reduce(R.maxBy(square), 0, {3, -5, 4, 1, -2}) --> -5
		R.reduce(R.maxBy(square), 0, {}) --> 0

				R.min

					Util

Added in v0.1.0

Ord a => a -> a -> a

	Returns the smaller of its two arguments.

see R.minBy,R.max

		R.min(789, 123) --> 123
		R.min('a', 'b') --> 'a'

				R.minBy

					Util

Added in v0.1.0

Ord b => (a -> b) -> a -> a -> a

	Takes a function and two values, and returns whichever value produces the	smaller result when passed to the provided function.

see R.min,R.maxBy

		local square = n => n * n
		R.minBy(square, -3, 2) --> 2
		R.reduce(R.minBy(square), 100, {3, -5, 4, 1, -2}) --> 1
		R.reduce(R.minBy(square), 100, {}) --> 100

				R.pack

					Util

Added in v0.1.0
Not Curried

*... -> [*...]

	Unlike the lua `table.pack` function that `R.pack` will return a simple array with the given arguments.

		R.pack(1,2,3,4) --> {1,2,3,4}

				R.project

					Util

Added in v0.1.0

[k] -> [{k: v}] -> [{k: v}]

	Reasonable analog to SQL `select` statement.

		local abby = {name = 'Abby', age = 7, hair = 'blond', grade = 2}
		local fred = {name = 'Fred', age = 12, hair = 'brown', grade = 7}
		local kids = {abby, fred}
		R.project({'name', 'grade'}, kids) --> {{name = 'Abby', grade = 2}, {name = 'Fred', grade = 7}}

				R.safeEquals

					Util

Added in v0.1.0
Not Curried

Alias To R.equals

				R.same

					Util

Added in v0.1.0

a -> b -> Boolean

	Returns `true` if its arguments are equivalent by reference, `false` otherwise.

see R.equals

		R.same(1, 1) --> true
		R.same(1, '1') --> false
		R.same({1, 2, 3}, {1, 2, 3}) --> false
		local a = {}
		local b = a
		R.same(a, b) --> true

				R.second

					Util

Added in v0.1.0
Not Curried

a, b, *... -> b

    Returns the second argument.

		local t = R.second('a', 'b', 'c') --> 'b'
		local t = R.second('a') --> nil

				R.show

					Util

Added in v0.2.0
Not Curried

* -> nil

	Print all the arguments to stdout

		R.show(1,2,"hell", {a=b={c="hello"}})

				R.symmetricDifference

					Util

Added in v0.1.0

[*] -> [*] -> [*]

	Finds the set (i.e. no duplicates) of all elements contained in the first or	second list, but not both.

see R.symmetricDifferenceWith,R.difference,R.differenceWith

		R.symmetricDifference({1,2,3,4}, {7,6,5,4,3}) --> {1,2,7,6,5}
		R.symmetricDifference({7,6,5,4,3}, {1,2,3,4}) --> {7,6,5,1,2}

				R.symmetricDifferenceWith

					Util

Added in v0.1.0

((a, a) -> Boolean) -> [a] -> [a] -> [a]

	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.

see R.symmetricDifference,R.difference,R.differenceWith

		local eqA = R.eqBy(R.prop('a'))
		local l1 = {{a=1}, {a=2}, {a=3}, {a=4}}
		local l2 = {{a=3}, {a=4}, {a=5}, {a=6}}
		R.symmetricDifferenceWith(eqA, l1, l2) --> {{a=1}, {a=2}, {a=5}, {a=6}}

				R.toJson

					Util

Added in v0.3.0
Not Curried

* -> String

	Convert the value to string(json format) recursively

		local t = R.toJson() --> "[null]"
		local t = R.toJson("") -->
		local t = R.toJson({a=1}) --> "{"a":1}"

				R.toString

					Util

Added in v0.1.0
Not Curried

* -> String

	Convert the value to string recursively.

		local t = R.toString() --> "nil"
		local t = R.toString("") --> ""
		local t = R.toString({a=1}) --> "{["a"]=1}"