UNPKG

list

Version:

Fast purely functional immutable lists.

98 lines (97 loc) 3.63 kB
import * as L from "./index"; export { Node, List, list, isList, length, of, empty, first, head, last, flatten, pop, init, tail, from, toArray, reverse, backwards, sort, group, dropRepeats, isEmpty } from "./index"; function curry2(f) { return function curried(a, b) { return arguments.length === 2 ? f(a, b) : function (b) { return f(a, b); }; }; } function curry3(f) { return function curried(a, b, c) { switch (arguments.length) { case 3: return f(a, b, c); case 2: return function (c) { return f(a, b, c); }; default: return curry2(function (b, c) { return f(a, b, c); }); } }; } function curry4(f) { return function curried(a, b, c, d) { switch (arguments.length) { case 4: return f(a, b, c, d); case 3: return function (d) { return f(a, b, c, d); }; case 2: return curry2(function (c, d) { return f(a, b, c, d); }); default: return curry3(function (b, c, d) { return f(a, b, c, d); }); } }; } export var prepend = curry2(L.prepend); export var append = curry2(L.append); export var pair = curry2(L.pair); export var repeat = curry2(L.repeat); export var times = curry2(L.times); export var nth = curry2(L.nth); export var map = curry2(L.map); export var forEach = curry2(L.forEach); export var pluck = curry2(L.pluck); export var intersperse = curry2(L.intersperse); export var range = curry2(L.range); export var filter = curry2(L.filter); export var reject = curry2(L.reject); export var partition = curry2(L.partition); export var join = curry2(L.join); export var ap = curry2(L.ap); export var flatMap = curry2(L.flatMap); export var chain = flatMap; export var every = curry2(L.every); export var all = curry2(L.all); export var some = curry2(L.some); export var any = curry2(L.any); export var none = curry2(L.none); export var find = curry2(L.find); export var findLast = curry2(L.findLast); export var indexOf = curry2(L.indexOf); export var lastIndexOf = curry2(L.lastIndexOf); export var findIndex = curry2(L.findIndex); export var includes = curry2(L.includes); export var contains = includes; export var equals = curry2(L.equals); export var concat = curry2(L.concat); export var take = curry2(L.take); export var takeLast = curry2(L.takeLast); export var drop = curry2(L.drop); export var dropRepeatsWith = curry2(L.groupWith); export var dropLast = curry2(L.dropLast); export var takeWhile = curry2(L.takeWhile); export var takeLastWhile = curry2(L.takeLastWhile); export var dropWhile = curry2(L.dropWhile); export var splitAt = curry2(L.splitAt); export var splitWhen = curry2(L.splitWhen); export var splitEvery = curry2(L.splitEvery); export var sortBy = curry2(L.sortBy); export var sortWith = curry2(L.sortWith); export var groupWith = curry2(L.groupWith); export var zip = curry2(L.zip); export var sequence = curry2(L.sequence); export var foldl = curry3(L.foldl); export var reduce = foldl; export var scan = curry3(L.scan); export var foldr = curry3(L.foldr); export var traverse = curry3(L.traverse); export var equalsWith = curry3(L.equalsWith); export var reduceRight = foldr; export var update = curry3(L.update); export var adjust = curry3(L.adjust); export var slice = curry3(L.slice); export var remove = curry3(L.remove); export var insert = curry3(L.insert); export var insertAll = curry3(L.insertAll); export var zipWith = curry3(L.zipWith); export var foldlWhile = curry4(L.foldlWhile); export var reduceWhile = foldlWhile;