UNPKG

list

Version:

Fast purely functional immutable lists.

35 lines (34 loc) 1.09 kB
import { List, equals, map, filter, empty, concat, foldl, of, ap, chain, traverse } from "./index"; export * from "./index"; var flOf = "fantasy-land/of"; var flEmpty = "fantasy-land/empty"; List.prototype["fantasy-land/equals"] = function (l) { return equals(this, l); }; List.prototype["fantasy-land/map"] = function (f) { return map(f, this); }; List.prototype[flOf] = of; List[flOf] = List.prototype[flOf]; List.prototype["fantasy-land/ap"] = function (listF) { return ap(listF, this); }; List.prototype["fantasy-land/chain"] = function (f) { return chain(f, this); }; List.prototype["fantasy-land/filter"] = function (predicate) { return filter(predicate, this); }; List.prototype[flEmpty] = function () { return empty(); }; List[flEmpty] = List.prototype[flEmpty]; List.prototype["fantasy-land/concat"] = function (right) { return concat(this, right); }; List.prototype["fantasy-land/reduce"] = function (f, initial) { return foldl(f, initial, this); }; List.prototype["fantasy-land/traverse"] = function (of, f) { return traverse(of, f, this); };