{"id":14155365,"url":"https://github.com/mitranim/fpx","last_synced_at":"2025-08-31T12:41:38.741Z","repository":{"id":57241255,"uuid":"60565301","full_name":"mitranim/fpx","owner":"mitranim","description":"Functional programming extensions for JS. Lightweight replacement for Lodash.","archived":false,"fork":false,"pushed_at":"2022-02-15T16:22:50.000Z","size":656,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-23T21:18:25.361Z","etag":null,"topics":["functional-programming","lodash","toolbox","toolkit","utility","utils"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitranim.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-06T22:34:27.000Z","updated_at":"2024-06-20T18:50:41.000Z","dependencies_parsed_at":"2022-09-07T23:13:13.914Z","dependency_job_id":null,"html_url":"https://github.com/mitranim/fpx","commit_stats":null,"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/mitranim/fpx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Ffpx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Ffpx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Ffpx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Ffpx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitranim","download_url":"https://codeload.github.com/mitranim/fpx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Ffpx/sbom","scorecard":{"id":95115,"data":{"date":"2022-08-15","repo":{"name":"github.com/mitranim/fpx","commit":"28a158ceb4bbc4604179d6a0c7cf257e6990c15a"},"scorecard":{"version":"v4.5.0-17-g7772984","commit":"777298477c07c262a4ec7e95ceee839b7b3b75ae"},"score":5.2,"checks":[{"name":"Code-Review","score":0,"reason":"no reviews found","details":["Warn: no reviews found for commit: 28a158ceb4bbc4604179d6a0c7cf257e6990c15a","Warn: no reviews found for commit: 747239e8af5152e51951a11ebd7cb1b4e6006acd","Warn: no reviews found for commit: ea522d8c2437bf328c60bdde257bd473b4c1d433","Warn: no reviews found for commit: b1be51b6369bf4c063ed3fe97d6a2ac2ade5f679","Warn: no reviews found for commit: f6939d6eb740845704a3dd56b898095977cec18c","Warn: no reviews found for commit: 8dd01cb4ebf4fa9fb932c3913d507551319aeb26","Warn: no reviews found for commit: 56ad6e093aa4f5bdab7ef7f663dc02fc0294d7da","Warn: no reviews found for commit: 44b353226d37d0f12d70381c704cbb3fc60a8c32","Warn: no reviews found for commit: 93740225b5da5f2ddb0d21f37335acb7472fca91","Warn: no reviews found for commit: b98df3f7194124941aaea15c37f4e5643ea798ad","Warn: no reviews found for commit: 89f806c3990b281c473898b9e56b7ea2568e02f0","Warn: no reviews found for commit: b9c6aff1f72bae96862e8aac9aa8ae9695c3c447","Warn: no reviews found for commit: 5f792135615188f074de710b5ebd58ca223804c7","Warn: no reviews found for commit: 61f2c75e69ffeb0518d74ea2a26c1a4fe016ba0b","Warn: no reviews found for commit: 68e46bf942e65192699c781586c995ed1949df1a","Warn: no reviews found for commit: 92475b07bcbdd2831e45051c1e6c711938e24359","Warn: no reviews found for commit: 23a4cfdd877ce78e06905d989287483a9454c09f","Warn: no reviews found for commit: 61805a9ef6e5e965db83b27ac53f641a1548d168","Warn: no reviews found for commit: 98c02ecdd0a7fa46fd74b00c216e731b97993c93","Warn: no reviews found for commit: 6759e3f39ec56d9f44328f50df8b360a742c2807","Warn: no reviews found for commit: 8375bad05308a896dc417a3f497ffffda8d3843c","Warn: no reviews found for commit: 9a8726459980d05afe7ce5542e4c4cbc7d4611ff","Warn: no reviews found for commit: c5c6e75bb0b5c7064e2eb10935dbe80ea0966b36","Warn: no reviews found for commit: 9af17efe3d2c398b25843098d37b989810fc69b9","Warn: no reviews found for commit: 1c6e85cf4941f7a12f70b8de33157ac0327b7e2b","Warn: no reviews found for commit: 5b777b8a22594f52f26af26f9221f9e17dc502bf","Warn: no reviews found for commit: d036e760cee874e5bd758f781b5e3125a7cecbf3","Warn: no reviews found for commit: 46c8eef1a4d65158485cde4d255d145aa96370f1","Warn: no reviews found for commit: e69da76070dc4b607f4e6b4ed97a9679334a2252","Warn: no reviews found for commit: 716b7003ac71a9b49c651a90f06b52f1b2b1eebf"],"documentation":{"short":"Determines if the project requires code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) out of 30 and 0 issue activity out of 1 found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no badge detected","details":null,"documentation":{"short":"Determines if the project has a CII Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#cii-best-practices"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":["Warn: no GitHub releases found"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"no vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#branch-protection"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"no published package detected","details":["Warn: no GitHub publishing workflow detected"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: : doc/api/arrCopy.md:1"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#license"}},{"name":"Token-Permissions","score":10,"reason":"tokens are read-only in GitHub workflows","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info: GitHub-owned GitHubActions are pinned","Info: Third-party GitHubActions are pinned","Info: Dockerfile dependencies are pinned","Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles","Info: no insecure (not pinned by hash) dependency downloads found in shell scripts"],"documentation":{"short":"Determines if the project has declared and pinned its dependencies.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":-1,"reason":"internal error: internal error: Client.Search.Code: Search.Code: GET https://api.github.com/search/code?q=github.com+mitranim+fpx+repo%3Agoogle%2Foss-fuzz+in%3Afile+filename%3Aproject.yaml: 403 You have exceeded a secondary rate limit. Please wait a few minutes before you try again. []","details":null,"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":null,"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#security-policy"}},{"name":"Dependency-Update-Tool","score":0,"reason":"no update tool detected","details":["Warn: dependabot config file not detected in source location.\n\t\t\tWe recommend setting this configuration in code so it can be easily verified by others.","Warn: renovatebot config file not detected in source location.\n\t\t\tWe recommend setting this configuration in code so it can be easily verified by others."],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/777298477c07c262a4ec7e95ceee839b7b3b75ae/docs/checks.md#dependency-update-tool"}}]},"last_synced_at":"2025-08-15T08:49:08.258Z","repository_id":57241255,"created_at":"2025-08-15T08:49:08.258Z","updated_at":"2025-08-15T08:49:08.258Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272982765,"owners_count":25025984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional-programming","lodash","toolbox","toolkit","utility","utils"],"created_at":"2024-08-17T08:02:58.886Z","updated_at":"2025-08-31T12:41:38.711Z","avatar_url":"https://github.com/mitranim.png","language":"JavaScript","funding_links":[],"categories":["functional-programming"],"sub_categories":[],"readme":"## Overview\n\n`fpx`: **F**unctional **P**rogramming e**X**tensions for JavaScript. Lightweight replacement for Lodash. Stuff that should be built into the language.\n\nFeatures:\n\n  * Higher-order functions for data structures.\n    * Common FP tools like `map`, `filter`, and many more.\n    * Compatible with arbitrary iterables such as lists, sets, maps, dicts.\n  * Boolean tests for common types and interfaces.\n  * Minifiable type assertions.\n  * Type conversions.\n  * Tuned for performance.\n  * Small and dependency-free. Single file. Native JS module.\n\nDifferences from Lodash:\n\n  * Supports arbitrary iterables and iterators, including sets and maps.\n  * Type assertions and conversions.\n  * Much smaller and simpler.\n\n## TOC\n\n* [#Usage](#usage)\n* [#Why](#why)\n* [#Perf](#perf)\n* [#API](#api)\n   * [#`function bind`](#function-bind)\n   * [#`function not`](#function-not)\n   * [#`function is`](#function-is)\n   * [#`function truthy`](#function-truthy)\n   * [#`function falsy`](#function-falsy)\n   * [#`function isNil`](#function-isnil)\n   * [#`function isSome`](#function-issome)\n   * [#`function isBool`](#function-isbool)\n   * [#`function isNum`](#function-isnum)\n   * [#`function isFin`](#function-isfin)\n   * [#`function isFinNeg`](#function-isfinneg)\n   * [#`function isFinPos`](#function-isfinpos)\n   * [#`function isInt`](#function-isint)\n   * [#`function isNat`](#function-isnat)\n   * [#`function isIntNeg`](#function-isintneg)\n   * [#`function isIntPos`](#function-isintpos)\n   * [#`function isNaN`](#function-isnan)\n   * [#`function isInf`](#function-isinf)\n   * [#`function isBigInt`](#function-isbigint)\n   * [#`function isStr`](#function-isstr)\n   * [#`function isSym`](#function-issym)\n   * [#`function isKey`](#function-iskey)\n   * [#`function isJunk`](#function-isjunk)\n   * [#`function isComp`](#function-iscomp)\n   * [#`function isPrim`](#function-isprim)\n   * [#`function isFun`](#function-isfun)\n   * [#`function isFunSync`](#function-isfunsync)\n   * [#`function isFunGen`](#function-isfungen)\n   * [#`function isFunAsync`](#function-isfunasync)\n   * [#`function isFunAsyncGen`](#function-isfunasyncgen)\n   * [#`function isObj`](#function-isobj)\n   * [#`function isStruct`](#function-isstruct)\n   * [#`function isArr`](#function-isarr)\n   * [#`function isReg`](#function-isreg)\n   * [#`function isDate`](#function-isdate)\n   * [#`function isValidDate`](#function-isvaliddate)\n   * [#`function isInvalidDate`](#function-isinvaliddate)\n   * [#`function isSet`](#function-isset)\n   * [#`function isMap`](#function-ismap)\n   * [#`function isPromise`](#function-ispromise)\n   * [#`function isIter`](#function-isiter)\n   * [#`function isIterAsync`](#function-isiterasync)\n   * [#`function isIterator`](#function-isiterator)\n   * [#`function isIteratorAsync`](#function-isiteratorasync)\n   * [#`function isGen`](#function-isgen)\n   * [#`function isCls`](#function-iscls)\n   * [#`function isDict`](#function-isdict)\n   * [#`function isList`](#function-islist)\n   * [#`function isSeq`](#function-isseq)\n   * [#`function isVac`](#function-isvac)\n   * [#`function isScalar`](#function-isscalar)\n   * [#`function isInst`](#function-isinst)\n   * [#`function isListOf`](#function-islistof)\n   * [#`function isEmpty`](#function-isempty)\n   * [#`function hasMeth`](#function-hasmeth)\n   * [#`function req`](#function-req)\n   * [#`function opt`](#function-opt)\n   * [#`function reqInst`](#function-reqinst)\n   * [#`function optInst`](#function-optinst)\n   * [#`function only`](#function-only)\n   * [#`function arrOf`](#function-arrof)\n   * [#`function prim`](#function-prim)\n   * [#`function bool`](#function-bool)\n   * [#`function num`](#function-num)\n   * [#`function fin`](#function-fin)\n   * [#`function int`](#function-int)\n   * [#`function nat`](#function-nat)\n   * [#`function intPos`](#function-intpos)\n   * [#`function str`](#function-str)\n   * [#`function dict`](#function-dict)\n   * [#`function struct`](#function-struct)\n   * [#`function scalar`](#function-scalar)\n   * [#`function inst`](#function-inst)\n   * [#`function add`](#function-add)\n   * [#`function sub`](#function-sub)\n   * [#`function mul`](#function-mul)\n   * [#`function div`](#function-div)\n   * [#`function rem`](#function-rem)\n   * [#`function lt`](#function-lt)\n   * [#`function gt`](#function-gt)\n   * [#`function lte`](#function-lte)\n   * [#`function gte`](#function-gte)\n   * [#`function neg`](#function-neg)\n   * [#`function inc`](#function-inc)\n   * [#`function dec`](#function-dec)\n   * [#`function nop`](#function-nop)\n   * [#`function True`](#function-true)\n   * [#`function False`](#function-false)\n   * [#`function id`](#function-id)\n   * [#`function di`](#function-di)\n   * [#`function val`](#function-val)\n   * [#`function panic`](#function-panic)\n   * [#`function render`](#function-render)\n   * [#`function show`](#function-show)\n   * [#`function npo`](#function-npo)\n   * [#`function hasOwn`](#function-hasown)\n   * [#`function hasOwnEnum`](#function-hasownenum)\n   * [#`function mut`](#function-mut)\n   * [#`function mapDict`](#function-mapdict)\n   * [#`function pick`](#function-pick)\n   * [#`function omit`](#function-omit)\n   * [#`function pickKeys`](#function-pickkeys)\n   * [#`function omitKeys`](#function-omitkeys)\n   * [#`function more`](#function-more)\n   * [#`function alloc`](#function-alloc)\n   * [#`function arr`](#function-arr)\n   * [#`function arrCopy`](#function-arrcopy)\n   * [#`function slice`](#function-slice)\n   * [#`function keys`](#function-keys)\n   * [#`function values`](#function-values)\n   * [#`function valuesCopy`](#function-valuescopy)\n   * [#`function entries`](#function-entries)\n   * [#`function reify`](#function-reify)\n   * [#`function vac`](#function-vac)\n   * [#`function indexOf`](#function-indexof)\n   * [#`function includes`](#function-includes)\n   * [#`function concat`](#function-concat)\n   * [#`function append`](#function-append)\n   * [#`function prepend`](#function-prepend)\n   * [#`function len`](#function-len)\n   * [#`function hasLen`](#function-haslen)\n   * [#`function each`](#function-each)\n   * [#`function map`](#function-map)\n   * [#`function mapMut`](#function-mapmut)\n   * [#`function mapCompact`](#function-mapcompact)\n   * [#`function filter`](#function-filter)\n   * [#`function reject`](#function-reject)\n   * [#`function compact`](#function-compact)\n   * [#`function remove`](#function-remove)\n   * [#`function fold`](#function-fold)\n   * [#`function find`](#function-find)\n   * [#`function procure`](#function-procure)\n   * [#`function every`](#function-every)\n   * [#`function some`](#function-some)\n   * [#`function head`](#function-head)\n   * [#`function last`](#function-last)\n   * [#`function init`](#function-init)\n   * [#`function tail`](#function-tail)\n   * [#`function take`](#function-take)\n   * [#`function count`](#function-count)\n   * [#`function compare`](#function-compare)\n   * [#`function compareFin`](#function-comparefin)\n   * [#`function sort`](#function-sort)\n   * [#`function reverse`](#function-reverse)\n   * [#`function index`](#function-index)\n   * [#`function group`](#function-group)\n   * [#`function partition`](#function-partition)\n   * [#`function sum`](#function-sum)\n   * [#`function zip`](#function-zip)\n   * [#`function mapFrom`](#function-mapfrom)\n   * [#`function range`](#function-range)\n   * [#`function span`](#function-span)\n   * [#`function times`](#function-times)\n   * [#`function repeat`](#function-repeat)\n   * [#`function set`](#function-set)\n   * [#`function setCopy`](#function-setcopy)\n* [#License](#license)\n* [#Misc](#misc)\n\n## Usage\n\nIn browsers and Deno, import by URL:\n\n```js\nimport * as f from 'https://cdn.jsdelivr.net/npm/fpx@0.12.3/fpx.mjs'\n```\n\nWhen using Node or NPM-oriented bundlers like Esbuild:\n\n```sh\nnpm i -E fpx\n```\n\n```js\nimport * as f from 'fpx'\nimport * as f from './node_modules/fpx/fpx.mjs'\n```\n\n## Why\n\n* Built-ins are insufficient.\n* Other libraries are too large.\n* Other libraries are annoying to use.\n* Other libraries lack vital tools.\n\n### Simplicity\n\n\u003e Programs must be written for people to read, and only incidentally for machines to execute.\n\u003e\n\u003e _— Abelson \u0026 Sussman, \"Structure and Interpretation of Computer Programs\"_\n\nI believe that _all code_ should strive to be simple and educational. This gives me a massive distaste for most code.\n\nFpx is tuned for brevity, readability, clarity in addition to performance. If you want to understand how this kind of library works, how higher-order functions work, how to manipulate JS data structures, Fpx should hopefully provide a good read.\n\n### Assertions\n\nAssertions go a **long** way in debugging. Fail fast, catch bugs early. In asynchronous code, validating inputs as early as possible, instead of letting it fail mysteriously later, can save you hours of debugging.\n\nHere's the traditional way of doing assertions:\n\n```js\nfunction someHigherOrderFunction(fun) {\n  if (typeof fun !== 'function') {\n    throw TypeError(`expected a function, got ${fun}`)\n  }\n  // Actual code after the assertion.\n}\n\nsomeHigherOrderFunction({one: 10})\n// uncaught TypeError: expected a function, got [object Object]\n```\n\nAnnoying to type and **really** bad for minification. Some folks strip assertions from production builds, but I find the idea flawed. Even in production, failing fast is better than failing mysteriously, and assertions help with debugging when it inevitably fails.\n\nFpx provides a better alternative:\n\n```js\nfunction someHigherOrderFunction(fun) {\n  f.req(fun, f.isFun)\n  // Actual code after the assertion.\n}\n\nsomeHigherOrderFunction({one: 10})\n// uncaught TypeError: expected {\"one\":10} to satisfy test isFun\n```\n\nMuch better. Easy to type with editor autocompletion, produces good error messages, and minifies really well. In a minified build, the function name will be mangled, which is good for bundle size. The mangled name is a non-issue with a source map, which you need for debugging anyway.\n\nTo support this style of coding, Fpx provides [#`req`](#function-req) and a bevy of boolean tests.\n\n## Perf\n\nFpx is carefully tuned for performance. Functions covered by benchmarks appear comparable to their native or Lodash equivalents. Many appear significantly faster.\n\nJS performance is complicated and _very_ unstable, Fpx's benchmark suite is limited and checked only in V8. When in doubt, measure in your particular environment.\n\n## API\n\nAlso see changelog: [changelog.md](changelog.md).\n\n### `function bind`\n\nLinks: [source](fpx.mjs#L3); [test/example](test/test.mjs#L122).\n\nLike [`Function.prototype.bind`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind), but instead of taking `this` as an argument, takes it contextually. By default `this` is `undefined`. To set it, use `f.bind.call`.\n\nReturns a new function that represents [partial application](https://en.wikipedia.org/wiki/Partial_application) of the given function, a common tool in functional programming. When called, it joins arguments from both calls and invokes the original function. Think of it like splitting a function call in two, or more. Performance is inferior to closures; avoid in hotspots.\n\n```js\nconst inc = f.bind(f.add, 1)\n\ninc(2)\n// 3\n```\n\nNote: Fpx no longer provides facilities for currying. Experience has shown it to be extremely error prone. Currying, as seen in purely functional languages such as Haskell, tends to care about the amount of arguments. Calling a curried function may either create a new function, or call the underlying function (possibly side-effectful). This approach works reasonably well in statically typed languages, but not in JS where all functions are variadic and it's conventional to sometimes pass extra utility arguments \"just in case\", which the callee may or may not care about. `bind` is different because the created function will always call the original function, regardless of how many arguments were passed.\n\n### `function not`\n\nLinks: [source](fpx.mjs#L5); [test/example](test/test.mjs#L141).\n\nReturns a new function that negates the result of the given function, like a delayed `!`.\n\n```js\nfunction eq(a, b) {return a === b}\n\nconst different = f.not(eq)\n\ndifferent(10, 20)\n// !eq(10, 20) = true\n\n// equivalent:\nfunction different(a, b) {return !eq(a, b)}\n```\n\n### `function is`\n\nLinks: [source](fpx.mjs#L12); [test/example](test/test.mjs#L165).\n\nIdentity test: same as `===`, but considers `NaN` equal to `NaN`. Equivalent to [_SameValueZero_](https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero) as defined by the language spec. Used internally in Fpx for all identity tests.\n\nNote that [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) implements [_SameValue_](https://www.ecma-international.org/ecma-262/6.0/#sec-samevalue), which treats `-0` and `+0` as _distinct values_. This is typically undesirable. As a result, you should prefer `f.is` over `===` or `Object.is`.\n\n```js\nf.is(1, '1')\n// false\n\nf.is(NaN, NaN)\n// true\n```\n\n### `function truthy`\n\nLinks: [source](fpx.mjs#L13); [test/example](test/test.mjs#L151).\n\nSame as `!!` or `Boolean`. Sometimes useful with higher-order functions.\n\n### `function falsy`\n\nLinks: [source](fpx.mjs#L14); [test/example](test/test.mjs#L158).\n\nSame as `!`. Sometimes useful with higher-order functions.\n\n### `function isNil`\n\nLinks: [source](fpx.mjs#L15); [test/example](test/test.mjs#L175).\n\nTrue for `null` and `undefined`. Same as `value == null`. Incidentally, these are the only values that produce an exception when attempting to read a property: `null.someProperty`.\n\n```js\n// Definition\nfunction isNil(value) {return value == null}\n\nf.isNil(null)\n// true\n\nf.isNil(undefined)\n// true\n\nf.isNil(false)\n// false\n```\n\n### `function isSome`\n\nLinks: [source](fpx.mjs#L16); [test/example](test/test.mjs#L183).\n\nInverse of [#`isNil`](#function-isnil). False for `null` and `undefined`, true for other values.\n\n### `function isBool`\n\nLinks: [source](fpx.mjs#L17); [test/example](test/test.mjs#L191).\n\nSame as `typeof val === 'boolean'`.\n\n### `function isNum`\n\nLinks: [source](fpx.mjs#L18); [test/example](test/test.mjs#L200).\n\nSame as `typeof val === 'number'`. True if the value is a primitive number, _including_ `NaN` and `±Infinity`. In most cases you should use `isFin` instead.\n\n```js\nf.isNum(1)\n// true\nf.isNum('1')\n// false\nf.isNum(NaN)\n// true \u003c-- WTF\n```\n\n### `function isFin`\n\nLinks: [source](fpx.mjs#L19); [test/example](test/test.mjs#L211).\n\nSame as ES2015's [`Number.isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite). True if `val` is a primitive number and is _not_ `NaN` or `±Infinity`. In most cases you should prefer `isFin` over `isNum`.\n\n```js\nf.isFin(1)\n// true\nf.isFin('1')\n// false\nf.isFin(NaN)\n// false\n```\n\n### `function isFinNeg`\n\nLinks: [source](fpx.mjs#L20); [test/example](test/test.mjs#L225).\n\nTrue if value is finite (via [#`isFin`](#function-isfin)) and \u003c 0.\n\n### `function isFinPos`\n\nLinks: [source](fpx.mjs#L21); [test/example](test/test.mjs#L244).\n\nTrue if value is finite (via [#`isFin`](#function-isfin)) and \u003e 0.\n\n### `function isInt`\n\nLinks: [source](fpx.mjs#L22); [test/example](test/test.mjs#L263).\n\nTrue if value is an integer: finite via [#`isFin`](#function-isfin), without a fractional part.\n\n### `function isNat`\n\nLinks: [source](fpx.mjs#L23); [test/example](test/test.mjs#L281).\n\nTrue if value is a natural number: integer \u003e= 0. Also see [#`isIntPos`](#function-isintpos).\n\n### `function isIntNeg`\n\nLinks: [source](fpx.mjs#L24); [test/example](test/test.mjs#L299).\n\nTrue if value is integer \u003c 0. Also see [#`isFinNeg`](#function-isfinneg).\n\n### `function isIntPos`\n\nLinks: [source](fpx.mjs#L25); [test/example](test/test.mjs#L318).\n\nTrue if value is integer \u003e 0. Also see [#`isNat`](#function-isnat), [#`isFinPos`](#function-isfinpos).\n\n### `function isNaN`\n\nLinks: [source](fpx.mjs#L26); [test/example](test/test.mjs#L337).\n\nSame as ES2015's [`Number.isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN). True if value is _actually_ `NaN`. Doesn't coerce non-numbers to numbers, unlike global `isNaN`.\n\n### `function isInf`\n\nLinks: [source](fpx.mjs#L27); [test/example](test/test.mjs#L352).\n\nTrue if value is `-Infinity` or `Infinity`.\n\n### `function isBigInt`\n\nLinks: [source](fpx.mjs#L28); [test/example](test/test.mjs#L367).\n\nTrue if value is a primitive [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt). False for all other inputs, including `BigInt` object wrappers.\n\n### `function isStr`\n\nLinks: [source](fpx.mjs#L29); [test/example](test/test.mjs#L386).\n\nSame as `typeof val === 'string'`. True if value is a primitive string.\n\n### `function isSym`\n\nLinks: [source](fpx.mjs#L30); [test/example](test/test.mjs#L393).\n\nSame as `typeof val === 'symbol'`. True if value is a primitive symbol.\n\n### `function isKey`\n\nLinks: [source](fpx.mjs#L31); [test/example](test/test.mjs#L400).\n\nTrue if value qualifies as a dictionary key. True for all primitives excluding garbage values via [#`isJunk`](#function-isjunk).\n\n### `function isJunk`\n\nLinks: [source](fpx.mjs#L32); [test/example](test/test.mjs#L420).\n\nTrue for garbage values: [#nil](#function-isnil), [#`NaN`](#function-isnan), [#`±Infinity`](#function-isinf).\n\n### `function isComp`\n\nLinks: [source](fpx.mjs#L33); [test/example](test/test.mjs#L435).\n\nTrue if value is \"composite\" / \"compound\" / \"complex\". Opposite of [#`isPrim`](#function-isprim). Definition:\n\n```js\nfunction isComp(val) {return isObj(val) || isFun(val)}\n```\n\n### `function isPrim`\n\nLinks: [source](fpx.mjs#L34); [test/example](test/test.mjs#L449).\n\nTrue if value is a JS primitive: not an object, not a function. Opposite of [#`isComp`](#function-iscomp).\n\n### `function isFun`\n\nLinks: [source](fpx.mjs#L35); [test/example](test/test.mjs#L463).\n\nSame as `typeof val === 'function'`. True if value is any function, regardless of its type (arrow, async, generator, etc.).\n\n### `function isFunSync`\n\nLinks: [source](fpx.mjs#L36); [test/example](test/test.mjs#L487).\n\nTrue if the input is a normal sync function. False for generator functions or async functions.\n\n### `function isFunGen`\n\nLinks: [source](fpx.mjs#L37); [test/example](test/test.mjs#L497).\n\nTrue if the input is a sync generator function. False for normal sync functions and async functions.\n\n### `function isFunAsync`\n\nLinks: [source](fpx.mjs#L38); [test/example](test/test.mjs#L507).\n\nTrue if the input is an async non-generator function. False for sync functions, generator functions, or async generator functions.\n\n### `function isFunAsyncGen`\n\nLinks: [source](fpx.mjs#L39); [test/example](test/test.mjs#L517).\n\nTrue if the input is an async generator function. False for sync functions and async non-generator functions.\n\n### `function isObj`\n\nLinks: [source](fpx.mjs#L40); [test/example](test/test.mjs#L527).\n\nSame as `typeof val === 'object' \u0026\u0026 val !== null`. True for any JS object: plain dict, array, various other classes. Doesn't include functions, even though JS functions are extensible objects.\n\nNote: this is _not_ equivalent to Lodash's `_.isObject`, which counts functions as objects. Use [#`isComp`](#function-iscomp) for that.\n\nFor plain objects used as dictionaries, see [#`isDict`](#function-isdict). For fancy non-list objects, see [#`isStruct`](#function-isstruct).\n\n### `function isStruct`\n\nLinks: [source](fpx.mjs#L41); [test/example](test/test.mjs#L543).\n\nTrue if value is a non-iterable object. Excludes both [#sync iterables](#function-isiter) and [#async iterables](#function-isiterasync). Note that [#dicts](#function-isdict) are automatically structs, but not all structs are dicts.\n\n### `function isArr`\n\nLinks: [source](fpx.mjs#L42); [test/example](test/test.mjs#L560).\n\nAlias for [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). Used internally for all array checks.\n\nTrue if value is an instance of [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or its subclass. False for all other values, including non-array objects whose prototype is an array.\n\n### `function isReg`\n\nLinks: [source](fpx.mjs#L43); [test/example](test/test.mjs#L572).\n\nTrue if value is an instance of [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) or its subclass.\n\n### `function isDate`\n\nLinks: [source](fpx.mjs#L44); [test/example](test/test.mjs#L580).\n\nTrue of value is an instance of [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date). Most of the time you should prefer [#`isValidDate`](#function-isvaliddate).\n\n### `function isValidDate`\n\nLinks: [source](fpx.mjs#L45); [test/example](test/test.mjs#L588).\n\nTrue of value is an instance of [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) and its timestamp is [#finite](#function-isfin) rather than `NaN`.\n\n### `function isInvalidDate`\n\nLinks: [source](fpx.mjs#L46); [test/example](test/test.mjs#L595).\n\nTrue of value is an instance of [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) representing an invalid date whose timestamp is `NaN`.\n\n### `function isSet`\n\nLinks: [source](fpx.mjs#L47); [test/example](test/test.mjs#L602).\n\nTrue if value is an instance of [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) or its subclass.\n\n### `function isMap`\n\nLinks: [source](fpx.mjs#L48); [test/example](test/test.mjs#L612).\n\nTrue if value is an instance of [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) or its subclass.\n\n### `function isPromise`\n\nLinks: [source](fpx.mjs#L49); [test/example](test/test.mjs#L622).\n\nTrue if the value satisfies the ES2015 [promise interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n### `function isIter`\n\nLinks: [source](fpx.mjs#L50); [test/example](test/test.mjs#L631).\n\nTrue if the value satisfies the ES2015 [sync iterable interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). For _iterator_ rather than _iterable_, use [#`isIterator`](#function-isiterator).\n\n### `function isIterAsync`\n\nLinks: [source](fpx.mjs#L51); [test/example](test/test.mjs#L657).\n\nTrue if the value satisfies the ES2015 [async iterable interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of). For _iterator_ rather than _iterable_, use [#`isIteratorAsync`](#function-isiteratorasync).\n\n### `function isIterator`\n\nLinks: [source](fpx.mjs#L52); [test/example](test/test.mjs#L674).\n\nTrue if the value satisfies the ES2015 [sync iterator interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). For _iterable_ rather than _iterator_, use [#`isIter`](#function-isiter).\n\n### `function isIteratorAsync`\n\nLinks: [source](fpx.mjs#L53); [test/example](test/test.mjs#L700).\n\nTrue if the value satisfies the ES2015 [async iterator interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of). For _iterable_ rather than _iterator_, use [#`isIterAsync`](#function-isiterasync).\n\n### `function isGen`\n\nLinks: [source](fpx.mjs#L54); [test/example](test/test.mjs#L726).\n\nTrue if value is a [#sync iterator](#function-isiterator) created by calling a [generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator).\n\n### `function isCls`\n\nLinks: [source](fpx.mjs#L55); [test/example](test/test.mjs#L786).\n\nTrue if the input is a function with a prototype, likely to be a class. False for arrow functions such as `() =\u003e {}`, which don't have a prototype.\n\n### `function isDict`\n\nLinks: [source](fpx.mjs#L56); [test/example](test/test.mjs#L798).\n\nTrue for a \"plain object\" created via `{...}` or `Object.create(null)`. False for any other input, including instances of any class other than `Object`. Roughly equivalent to Lodash's `_.isPlainObject`.\n\nSee [#`isStruct`](#function-isstruct) for a more general definition of a non-iterable object.\n\n### `function isList`\n\nLinks: [source](fpx.mjs#L57); [test/example](test/test.mjs#L811).\n\nTrue for any array-like such as: `[]`, `arguments`, `TypedArray`, `NodeList`, etc. Used internally for most list checks. Note that _primitive strings are not considered lists_.\n\n### `function isSeq`\n\nLinks: [source](fpx.mjs#L58); [test/example](test/test.mjs#L826).\n\nTrue for any of:\n\n  * [#Array](#function-isarr)\n  * [#List](#function-islist)\n  * [#Set](#function-isset)\n  * [#Iterator](#function-isiterator)\n\nMany Fpx functions support arbitrary data structures compatible with [#`values`](#function-values), but some functions such as [#`arr`](#function-arr) allow only sequences, for sanity checking.\n\n### `function isVac`\n\nLinks: [source](fpx.mjs#L59); [test/example](test/test.mjs#L843).\n\nShort for \"is vacuous\" or \"is vacated\". Could also be called \"is falsy deep\". True if the input is [#falsy](#function-falsy) or a [#list](#function-islist) where all values are vacuous, recursively. Does not iterate non-lists. Also see complementary function [#`vac`](#function-vac).\n\n### `function isScalar`\n\nLinks: [source](fpx.mjs#L61); [test/example](test/test.mjs#L881).\n\nTrue for a value that could be considered a single scalar, rather than a collection / data structure:\n\n  * Any [#primitive](#function-isprim).\n  * Any [#object](#function-isobj) with a custom `.toString` method, distinct from both `Object.prototype.toString` and `Array.prototype.toString`.\n\n### `function isInst`\n\nLinks: [source](fpx.mjs#L69); [test/example](test/test.mjs#L918).\n\nSignature: `(val, Cls) =\u003e bool`.\n\nSame as `instanceof` but _does not_ implicitly convert the operand to an object. True only if the operand is already an instance of the given class.\n\n### `function isListOf`\n\nLinks: [source](fpx.mjs#L74); [test/example](test/test.mjs#L934).\n\nShortcut for `isList(val) \u0026\u0026 every(val, fun)`. True if the input is a list of values that satisfy the given predicate function.\n\n### `function isEmpty`\n\nLinks: [source](fpx.mjs#L79); [test/example](test/test.mjs#L953).\n\nTrue if the input is an empty collection such as list, set, map, or a primitive such as `null`. False for any other non-primitive. Treating primitives as \"empty\" is consistent with other Fpx functions that operate on collections.\n\n### `function hasMeth`\n\nLinks: [source](fpx.mjs#L86); [test/example](test/test.mjs#L970).\n\nTrue if the the given value has the given named method. Safe to call on primitives such as `null`. Always false for primitives.\n\n### `function req`\n\nLinks: [source](fpx.mjs#L94); [test/example](test/test.mjs#L990).\n\nSignature: `(val, test) =\u003e val` where `test: val =\u003e bool`.\n\nShort for \"require\". Minification-friendly assertion. If `!test(val)`, throws an informative `TypeError`. Otherwise, returns `val` as-is.\n\n```js\nf.req({one: `two`}, f.isObj)\n// {one: `two`}\n\nf.req('str', f.isFun)\n// uncaught TypeError: expected \"str\" to satisfy test isFun\n```\n\n### `function opt`\n\nLinks: [source](fpx.mjs#L108); [test/example](test/test.mjs#L1011).\n\nShort for \"optional\". If `val` is [#non-nil](#function-issome), uses [#`req`](#function-req) to validate it. Returns `val` as-is.\n\n### `function reqInst`\n\nLinks: [source](fpx.mjs#L113); [test/example](test/test.mjs#L1037).\n\nSignature: `(val, Cls) =\u003e val`.\n\nShort for \"require instance\". Asserts that `val` is an instance of the given class. Returns `val` as-is.\n\n### `function optInst`\n\nLinks: [source](fpx.mjs#L122); [test/example](test/test.mjs#L1059).\n\nShort for \"optional instance\". If `val` is [#non-nil](#function-issome), uses [#`reqInst`](#function-reqinst) to validate it. Returns `val` as-is.\n\n### `function only`\n\nLinks: [source](fpx.mjs#L127); [test/example](test/test.mjs#L1091).\n\nSignature: `(val, test) =\u003e val` where `test: val =\u003e bool`.\n\nType filtering utility. If `val` satisfies the given test function, returns `val` as-is. Otherwise returns `undefined`.\n\n### `function arrOf`\n\nLinks: [source](fpx.mjs#L129); [test/example](test/test.mjs#L1118).\n\nSignature: `(seq\u003cA\u003e, test) =\u003e A[]` where `test: A =\u003e true`.\n\nShortcut. Converts the input to an array via [#`arr`](#function-arr) and asserts that every element satisfies the given test function. Returns the resulting array.\n\n### `function prim`\n\nLinks: [source](fpx.mjs#L136); [test/example](test/test.mjs#L1130).\n\nShortcut for asserting that the input is a primitive. Throws for non-primitive inputs. Returns the input as-is.\n\n### `function bool`\n\nLinks: [source](fpx.mjs#L137); [test/example](test/test.mjs#L1147).\n\nSimilar to `val ?? false` but `val` must be [#nil](#function-isnil) or a [#boolean](#function-isbool), otherwise throws.\n\n### `function num`\n\nLinks: [source](fpx.mjs#L138); [test/example](test/test.mjs#L1162).\n\nSimilar to `val ?? 0` but `val` must be [#nil](#function-isnil) or a [#number](#function-isnum), otherwise throws.\n\n### `function fin`\n\nLinks: [source](fpx.mjs#L139); [test/example](test/test.mjs#L1178).\n\nSimilar to `val ?? 0` but `val` must be [#nil](#function-isnil) or a [#finite number](#function-isfin), otherwise throws.\n\n### `function int`\n\nLinks: [source](fpx.mjs#L140); [test/example](test/test.mjs#L1194).\n\nSimilar to `val ?? 0` but `val` must be [#nil](#function-isnil) or an [#integer](#function-isint), otherwise throws.\n\n### `function nat`\n\nLinks: [source](fpx.mjs#L141); [test/example](test/test.mjs#L1213).\n\nSimilar to `val ?? 0` but `val` must be [#nil](#function-isnil) or a [#natural number](#function-isnat), otherwise throws.\n\n### `function intPos`\n\nLinks: [source](fpx.mjs#L142); [test/example](test/test.mjs#L1233).\n\nSimilar to `val ?? 0` but `val` must be [#nil](#function-isnil) or a [#positive integer](#function-isintpos), otherwise throws.\n\n### `function str`\n\nLinks: [source](fpx.mjs#L143); [test/example](test/test.mjs#L1253).\n\nSimilar to `val ?? ''` but `val` must be [#nil](#function-isnil) or a [#string](#function-isstr), otherwise throws.\n\n### `function dict`\n\nLinks: [source](fpx.mjs#L144); [test/example](test/test.mjs#L1266).\n\nSimilar to `val ?? Object.create(null)` but `val` must be [#nil](#function-isnil) or a [#dict](#function-isdict), otherwise throws.\n\n### `function struct`\n\nLinks: [source](fpx.mjs#L145); [test/example](test/test.mjs#L1284).\n\nSimilar to `val ?? Object.create(null)` but `val` must be [#nil](#function-isnil) or a [#struct](#function-isstruct), otherwise throws.\n\nMost Fpx functions that operate on data structures, such as [#`filter`](#function-filter), support structs, treating them similarly to maps. A struct is considered a collection of its [#`values`](#function-values). Iterating over [#`keys`](#function-keys) or [#`entries`](#function-entries) is opt-in.\n\n### `function scalar`\n\nLinks: [source](fpx.mjs#L146); [test/example](test/test.mjs#L1301).\n\nType checking shortcut. Asserts that the input [#is scalar](#function-isscalar), returning it as-is.\n\n### `function inst`\n\nLinks: [source](fpx.mjs#L147); [test/example](test/test.mjs#L1314).\n\nSignature: `(any, typeof A) =\u003e A`.\n\nIdempotently converts an arbitrary input to a given class:\n\n  * If `isInst(val, cls)`, returns `val` as-is.\n  * Otherwise returns `new cls(val)`.\n\n```js\nconst newInst = f.inst([10, 20, 30], Set)\n// Set{10, 20, 30}\n\nconst oldInst = f.inst(newInst, Set)\n// Set{10, 20, 30}\n\nnewInst === oldInst\n// true\n```\n\n### `function add`\n\nLinks: [source](fpx.mjs#L155); [test/example](test/test.mjs#L1347).\n\nSame as `+`.\n\n### `function sub`\n\nLinks: [source](fpx.mjs#L156); [test/example](test/test.mjs#L1353).\n\nSame as `-`.\n\n### `function mul`\n\nLinks: [source](fpx.mjs#L157); [test/example](test/test.mjs#L1359).\n\nSame as `*`.\n\n### `function div`\n\nLinks: [source](fpx.mjs#L158); [test/example](test/test.mjs#L1365).\n\nSame as `/`.\n\n### `function rem`\n\nLinks: [source](fpx.mjs#L159); [test/example](test/test.mjs#L1371).\n\nSame as `%`.\n\n### `function lt`\n\nLinks: [source](fpx.mjs#L160); [test/example](test/test.mjs#L1379).\n\nSame as `\u003c`.\n\n### `function gt`\n\nLinks: [source](fpx.mjs#L161); [test/example](test/test.mjs#L1390).\n\nSame as `\u003e`.\n\n### `function lte`\n\nLinks: [source](fpx.mjs#L162); [test/example](test/test.mjs#L1401).\n\nSame as `\u003c=`.\n\n### `function gte`\n\nLinks: [source](fpx.mjs#L163); [test/example](test/test.mjs#L1412).\n\nSame as `\u003e=`.\n\n### `function neg`\n\nLinks: [source](fpx.mjs#L164); [test/example](test/test.mjs#L1423).\n\nArithmetic negation. Same as unary `-`.\n\n### `function inc`\n\nLinks: [source](fpx.mjs#L165); [test/example](test/test.mjs#L1435).\n\nIncrements by `1`.\n\n### `function dec`\n\nLinks: [source](fpx.mjs#L166); [test/example](test/test.mjs#L1443).\n\nDecrements by `1`.\n\n### `function nop`\n\nLinks: [source](fpx.mjs#L170); [test/example](test/test.mjs#L1451).\n\nEmpty function. Functional equivalent of `;` or `undefined`. Sometimes useful with higher-order functions.\n\n### `function True`\n\nLinks: [source](fpx.mjs#L171); [test/example](test/test.mjs#L1457).\n\nAlways returns `true`. Sometimes useful with higher order functions.\n\n### `function False`\n\nLinks: [source](fpx.mjs#L172); [test/example](test/test.mjs#L1465).\n\nAlways returns `false`. Sometimes useful with higher order functions.\n\n### `function id`\n\nLinks: [source](fpx.mjs#L173); [test/example](test/test.mjs#L1473).\n\nIdentity function: returns its first argument unchanged. Sometimes useful with higher-order functions.\n\n### `function di`\n\nLinks: [source](fpx.mjs#L174); [test/example](test/test.mjs#L1480).\n\nReturns its _second_ argument unchanged. Sometimes useful with higher-order functions.\n\n### `function val`\n\nLinks: [source](fpx.mjs#L175); [test/example](test/test.mjs#L1487).\n\nTakes a value and creates a function that always returns that value. Sometimes useful with higher order functions.\n\n```js\nconst constant = f.val(1)\n\nconstant()\n// 1\n\nconstant(`this input is ignored`)\n// 1\n```\n\n### `function panic`\n\nLinks: [source](fpx.mjs#L176); [test/example](test/test.mjs#L1501).\n\nSame as `throw` but an expression rather than a statement. Also sometimes useful with higher-order functions.\n\n```js\nconst x = someTest ? someValue : f.panic(Error(`unreachable`))\n```\n\n### `function render`\n\nLinks: [source](fpx.mjs#L178); [test/example](test/test.mjs#L95).\n\nRenders a value for user display. Counterpart to [#`show`](#function-show), which renders a value for debug purposes. Intended only for [#scalar](#function-isscalar) values. Rules:\n\n  * [#Nil](#function-isnil) → `''`.\n  * [#Scalar](#function-isscalar) → default JS stringification.\n  * All other inputs → `TypeError` exception.\n\n### `function show`\n\nLinks: [source](fpx.mjs#L184); [test/example](test/test.mjs#L42).\n\nRenders a value for debug purposes. Counterpart to [#`render`](#function-render), which renders a value for user display. Convenient for interpolating things into error messages. Used internally in assertion functions such as [#`req`](#function-req). Approximate rules:\n\n  * String → use `JSON.stringify`.\n  * Function → `[function ${val.name || val}]`.\n    * For named functions, this shorter representation is usually preferable to printing the entire source code.\n  * Object →\n    * Plain `{}` or `[]` → use `JSON.stringify`.\n    * Otherwise `[object \u003cname\u003e]`, prioritizing constructor name over `Symbol.toStringTag`.\n      * Exact opposite of default behavior for `Object.prototype.toString`.\n  * Otherwise → default JS stringification.\n\n### `function npo`\n\nLinks: [source](fpx.mjs#L209); [test/example](test/test.mjs#L1523).\n\nShort for \"null-prototype object\". Syntactic shortcut for `Object.create(null)`.\n\n### `function hasOwn`\n\nLinks: [source](fpx.mjs#L211); [test/example](test/test.mjs#L1529).\n\nSame as [`Object.prototype.hasOwnProperty`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty) but shorter and safe to call on primitives. Always false for primitives.\n\n### `function hasOwnEnum`\n\nLinks: [source](fpx.mjs#L216); [test/example](test/test.mjs#L1543).\n\nSame as [`Object.prototype.propertyIsEnumerable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable) but shorter and safe to call on primitives. Always false for primitives.\n\n### `function mut`\n\nLinks: [source](fpx.mjs#L221); [test/example](test/test.mjs#L1558).\n\nSignature: `(tar, src) =\u003e tar`.\n\nSimilar to [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign). Differences:\n\n  * Supports only one source argument.\n  * Much faster.\n  * Has sanity checks:\n    * Target must be a [#struct](#function-isstruct). Throws if target is a function or iterable.\n    * Source must be nil or a struct. Throws if source is an iterable, non-nil primitive, etc.\n    * Does not override inherited properties.\n    * Does not override own non-enumerable properties.\n\nThe refusal to override inherited and non-enumerable properties is good for some use cases, and bad for others. This is not just a faster sanity-checking substitute for `Object.assign`. It has different behaviors. Pick the right one for your use case.\n\n### `function mapDict`\n\nLinks: [source](fpx.mjs#L229); [test/example](test/test.mjs#L1681).\n\nSignature: `({[Key: A]}, A =\u003e B) =\u003e {[Key: B]}`.\n\nSimilar to [#`map`](#function-map) but for dicts. Creates a version of the given dict where values have been replaced by calling the given function for each value. Returns an empty dict if the input is [#nil](#function-isnil).\n\n### `function pick`\n\nLinks: [source](fpx.mjs#L236); [test/example](test/test.mjs#L1696).\n\nSignature: `({[Key: A]}, A =\u003e bool) =\u003e {[Key: A]}`.\n\nSimilar to [#`filter`](#function-filter) but for dicts. Returns a version of the given dict with only the properties for which `fun` returned something truthy. Returns an empty dict if the input is [#nil](#function-isnil).\n\n### `function omit`\n\nLinks: [source](fpx.mjs#L246); [test/example](test/test.mjs#L1706).\n\nSignature: `({[Key: A]}, A =\u003e bool) =\u003e {[Key: A]}`.\n\nSimilar to [#`reject`](#function-reject) but for dicts. Returns a version of the given dict without properties for which `fun` returned something truthy. Returns an empty dict if the input is [#nil](#function-isnil).\n\n### `function pickKeys`\n\nLinks: [source](fpx.mjs#L248); [test/example](test/test.mjs#L1716).\n\nSignature: `({[Key: A]}, keys) =\u003e {[Key: A]}`.\n\nReturns a version of the given dict, keeping only the given properties. Keys can be either a `Set` or an arbitrary [#sequence](#function-arr). Each key must satisfy [#`isKey`](#function-iskey). Existence is not required: missing properties are silently ignored. Returns an empty dict if the input is [#nil](#function-isnil).\n\n### `function omitKeys`\n\nLinks: [source](fpx.mjs#L255); [test/example](test/test.mjs#L1734).\n\nSignature: `({[Key: A]}, keys) =\u003e {[Key: A]}`.\n\nReturns a version of the given dict without the given properties. Keys must be an arbitrary sequence convertible to a `Set`. Returns an empty dict if the input is [#nil](#function-isnil).\n\n### `function more`\n\nLinks: [source](fpx.mjs#L265); [test/example](test/test.mjs#L1752).\n\nTakes an [#iterator](#function-isiterator), consumes one value, and returns true if the iterator is not yet finished. Shortcut for `val.next().done === false`.\n\n### `function alloc`\n\nLinks: [source](fpx.mjs#L266); [test/example](test/test.mjs#L1762).\n\nShortcut for allocating an array with a sanity check. Same as `Array(N)` but ensures that the input is a [#natural number](#function-nat) suitable for array length. Avoids unintentionally passing any non-natural input such as `Array(-1)`. Allows [#nil](#function-isnil), replacing it with `0`.\n\n### `function arr`\n\nLinks: [source](fpx.mjs#L267); [test/example](test/test.mjs#L1771).\n\nConverts an arbitrary [#sequence](#function-isseq) to an array. Allows the following inputs:\n\n  * [#Nil](#function-isnil): return `[]`.\n  * [#Array](#function-isarr): return as-is.\n  * [#List](#function-islist): convert via `Array.prototype.slice`.\n  * [#Set](#function-isset) or arbitrary [#iterator](#function-isiterator): convert to array by iterating.\n\nUnlike [#`values`](#function-values), `arr` rejects other inputs such as non-nil primitives, dicts, maps, arbitrary iterables, ensuring that the input is always a sequence.\n\n### `function arrCopy`\n\nLinks: [source](fpx.mjs#L268); [test/example](test/test.mjs#L1803).\n\nLike [#`arr`](#function-arr), converts an arbitrary sequence to an array. Unlike `arr,` always makes a copy. Mutating the output doesn't affect the original.\n\n### `function slice`\n\nLinks: [source](fpx.mjs#L273); [test/example](test/test.mjs#L1817).\n\nLike [`Array.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) but allows arbitrary [#sequences](#function-isseq) compatible with [#`arr`](#function-arr).\n\n### `function keys`\n\nLinks: [source](fpx.mjs#L282); [test/example](test/test.mjs#L1849).\n\nTakes an arbitrary input and returns an array of its keys:\n\n  * For non-objects: always `[]`.\n  * For [#iterables](#function-isiter) with `.keys()`: equivalent to converting the output of `.keys()` to an array. Implementation varies for performance.\n    * Examples: `Array`, `Set`, `Map`, and more.\n  * For [#lists](#function-islist): equivalent to above for arrays.\n  * For [#iterators](#function-iterator): exhausts the iterator, returning an array of indexes equivalent to `f.span(f.len(iterator))`. See [#`span`](#function-span) and [#`len`](#function-len).\n  * For [#structs](#function-isstruct): equivalent to [`Object.keys`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n### `function values`\n\nLinks: [source](fpx.mjs#L299); [test/example](test/test.mjs#L1872).\n\nTakes an arbitrary input and returns an array of its values:\n\n  * For non-objects: always `[]`.\n  * For [#arrays](#function-isarr): **returns as-is without copying**.\n  * For [#lists](#function-islist): slice to array.\n  * For [#iterables](#function-isiter) with `.values()`: equivalent to converting the output of `.values()` to an array. Implementation varies for performance.\n    * Examples: `Set`, `Map`, and more.\n  * For [#iterators](#function-iterator): equivalent to `[...iterator]`.\n  * For [#structs](#function-isstruct): equivalent to [`Object.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values).\n\n### `function valuesCopy`\n\nLinks: [source](fpx.mjs#L322); [test/example](test/test.mjs#L1892).\n\nVariant of [#`values`](#function-values) that always makes a copy. Mutating the output doesn't affect the original.\n\n### `function entries`\n\nLinks: [source](fpx.mjs#L324); [test/example](test/test.mjs#L1914).\n\nTakes an arbitrary input and returns an array of its entries (key-value tuples):\n\n  * For non-objects: always `[]`.\n  * For [#iterables](#function-isiter) with `.entries()`: equivalent to converting the output of `.entries()` to an array. Implementation varies for performance.\n    * Examples: `Set`, `Map`, and more.\n  * For [#lists](#function-islist): equivalent to above for arrays.\n  * For [#iterators](#function-iterator): exhausts the iterator, returning an array of entries where keys are indexes starting with 0.\n  * For [#structs](#function-isstruct): equivalent to [`Object.entries`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries).\n\n### `function reify`\n\nLinks: [source](fpx.mjs#L350); [test/example](test/test.mjs#L1933).\n\nTakes an arbitrary value and attempts to deeply materialize it. Any [#iterators](#function-iterator), or [#lists](#function-islist) that contain iterators, or lists that contain lists that contain iterators, etc., are converted to arrays. Does not inspect other data structures such as [#sets](#function-isset) or [#dicts](#function-isdict).\n\n### `function vac`\n\nLinks: [source](fpx.mjs#L354); [test/example](test/test.mjs#L1958).\n\nComplements [#`isVac`](#function-isvac). Returns `undefined` if the input is vacuous, otherwise returns the input as-is.\n\n### `function indexOf`\n\nLinks: [source](fpx.mjs#L356); [test/example](test/test.mjs#L1965).\n\nLike [`Array.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf). Differences:\n\n  * Uses [#`is`](#function-is) rather than `===`, therefore able to detect `NaN`.\n  * Input may be [#nil](#function-isnil) or any [#list](#function-islist).\n\n### `function includes`\n\nLinks: [source](fpx.mjs#L364); [test/example](test/test.mjs#L1986).\n\nLike [`Array.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes). Differences:\n\n  * Supports arbitrary iterables compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n\n### `function concat`\n\nLinks: [source](fpx.mjs#L365); [test/example](test/test.mjs#L2005).\n\nLike [`Array.prototype.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat). Differences:\n\n  * Takes two arguments, without rest/spread.\n  * Supports arbitrary iterables compatible with [#`values`](#function-values).\n  * Iterables may be [#nil](#function-isnil), equivalent to `[]`.\n\nNote: for individual elements, use [#`append`](#function-append) and\n[#`prepend`](#function-prepend).\n\n### `function append`\n\nLinks: [source](fpx.mjs#L366); [test/example](test/test.mjs#L2023).\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and appends an arbitrary value, returning the resulting array.\n\n### `function prepend`\n\nLinks: [source](fpx.mjs#L367); [test/example](test/test.mjs#L2038).\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and prepends an arbitrary value, returning the resulting array.\n\n### `function len`\n\nLinks: [source](fpx.mjs#L369); [test/example](test/test.mjs#L2073).\n\nUniversal length measurement:\n\n  * For non-objects: always 0.\n  * For iterables:\n    * For [#lists](#function-islist): same as `.length`.\n    * For ES2015 collections such as `Set`: same as `.size`.\n    * For iterators: exhausts the iterator, returning element count.\n  * For [#structs](#function-isstruct): equivalent to `Object.keys(val).length`.\n\n### `function hasLen`\n\nLinks: [source](fpx.mjs#L393); [test/example](test/test.mjs#L2077).\n\nShortcut for [#`len`](#function-len) \u003e 0.\n\n### `function each`\n\nLinks: [source](fpx.mjs#L395); [test/example](test/test.mjs#L2109).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e void) =\u003e void`.\n\nSimilar to `Array.prototype.forEach`, `Set.prototype.forEach`, `Map.prototype.forEach`, and so on. Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Doesn't support `this` or additional arguments.\n\n### `function map`\n\nLinks: [source](fpx.mjs#L400); [test/example](test/test.mjs#L2130).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e B) =\u003e B[]`.\n\nSimilar to [`Array.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Doesn't support `this` or additional arguments.\n\n### `function mapMut`\n\nLinks: [source](fpx.mjs#L402); [test/example](test/test.mjs#L2163).\n\nSimilar to [`Array.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). Differences:\n\n  * Mutates the input (which must be an array).\n  * Doesn't support `this` or additional arguments.\n\nFor a non-mutating version, see [#`map`](#function-map).\n\n### `function mapCompact`\n\nLinks: [source](fpx.mjs#L410); [test/example](test/test.mjs#L2179).\n\nEquivalent to `f.compact(f.map(val, fun))`. See [#`map`](#function-map) and [#`compact`](#function-compact).\n\n### `function filter`\n\nLinks: [source](fpx.mjs#L412); [test/example](test/test.mjs#L2192).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e bool) =\u003e A[]`.\n\nSimilar to [`Array.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Doesn't support `this` or additional arguments.\n\n### `function reject`\n\nLinks: [source](fpx.mjs#L419); [test/example](test/test.mjs#L2208).\n\nOpposite of [#`filter`](#function-filter). Equivalent to `f.filter(val, f.not(fun))`.\n\n### `function compact`\n\nLinks: [source](fpx.mjs#L421); [test/example](test/test.mjs#L2224).\n\nEquivalent to `f.filter(val, f.id)`. Takes an arbitrary iterable and returns an array of its truthy [#`values`](#function-values), discarding falsy values.\n\n### `function remove`\n\nLinks: [source](fpx.mjs#L427); [test/example](test/test.mjs#L2236).\n\nSignature: `(Iter\u003cA\u003e, A) =\u003e A[]`.\n\nTakes an arbitrary iterable and an element to remove. Returns an array of the iterable's [#`values`](#function-values), discarding each occurrence of this element, comparing via [#`is`](#function-is).\n\n### `function fold`\n\nLinks: [source](fpx.mjs#L431); [test/example](test/test.mjs#L2253).\n\nSignature: `(src: Iter\u003cA\u003e, acc: B, fun: (B, A) =\u003e B) =\u003e B`.\n\nSimilar to [`Array.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Arguments are `(src, acc, fun)` rather than `(fun, acc)`.\n  * Accumulator argument is mandatory.\n  * Doesn't support `this`.\n  * Iterator function receives exactly two arguments: accumulator and next value.\n\n### `function find`\n\nLinks: [source](fpx.mjs#L437); [test/example](test/test.mjs#L2269).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e bool) =\u003e A`.\n\nSimilar to [`Array.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Doesn't support `this` or additional arguments.\n\n### `function procure`\n\nLinks: [source](fpx.mjs#L443); [test/example](test/test.mjs#L2284).\n\nSignature: `(src: Iter\u003cA\u003e, fun: A =\u003e B) =\u003e B`.\n\nSimilar to [#`find`](#function-find), but returns the first truthy result of calling the iterator function, rather than the corresponding element. Equivalent to `f.find(f.map(src, fun), f.id)` but more efficient.\n\n### `function every`\n\nLinks: [source](fpx.mjs#L449); [test/example](test/test.mjs#L2301).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e bool) =\u003e bool`.\n\nSimilar to [`Array.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Doesn't support `this` or additional arguments.\n\n### `function some`\n\nLinks: [source](fpx.mjs#L455); [test/example](test/test.mjs#L2320).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e bool) =\u003e bool`.\n\nSimilar to [`Array.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Doesn't support `this` or additional arguments.\n\n### `function head`\n\nLinks: [source](fpx.mjs#L461); [test/example](test/test.mjs#L2339).\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and returns its first element or `undefined`.\n\n### `function last`\n\nLinks: [source](fpx.mjs#L470); [test/example](test/test.mjs#L2349).\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and returns its last element or `undefined`.\n\n### `function init`\n\nLinks: [source](fpx.mjs#L471); [test/example](test/test.mjs#L2359).\n\nShort for \"initial\". Takes an arbitrary iterable compatible with [#`values`](#function-values) and returns an array of all its values except last.\n\n### `function tail`\n\nLinks: [source](fpx.mjs#L472); [test/example](test/test.mjs#L2369).\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and returns an array of all its values except first.\n\n### `function take`\n\nLinks: [source](fpx.mjs#L473); [test/example](test/test.mjs#L2379).\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and returns N values from the start.\n\n### `function count`\n\nLinks: [source](fpx.mjs#L475); [test/example](test/test.mjs#L2411).\n\nSignature: `(src: Iter\u003cA\u003e, fun: A =\u003e B) =\u003e nat`.\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values), calls the given function for each value, and returns the count of truthy results. The count is between 0 and iterable length.\n\n### `function compare`\n\nLinks: [source](fpx.mjs#L483); [test/example](test/test.mjs#L2426).\n\nSignature: `(a, b) =\u003e -1 | 0 | 1`.\n\nEquivalent to the [default JS sort comparison algorithm](https://tc39.github.io/ecma262/#sec-sortcompare). Sometimes useful for sorting via [`Array.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) or [#`sort`](#function-sort), as a fallback.\n\n### `function compareFin`\n\nLinks: [source](fpx.mjs#L494); [test/example](test/test.mjs#L2436).\n\nSignature: `(a, b) =\u003e -1 | 0 | 1` where arguments are [#nil](#function-isnil) or [#finite](#function-isfin).\n\nSort comparison for finite numbers. Usable for [`Array.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) or [#`sort`](#function-sort). Throws on non-nil, non-finite arguments.\n\n### `function sort`\n\nLinks: [source](fpx.mjs#L502); [test/example](test/test.mjs#L2448).\n\nSignature: `(src: Iter\u003cA\u003e, fun?: (prev: A, next: A) =\u003e -1 | 0 | 1) =\u003e A[]`.\n\nSimilar to [`Array.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Always creates a new array. Does not mutate the input.\n\nThe comparison function is optional. If omitted, default JS sorting is used.\n\n### `function reverse`\n\nLinks: [source](fpx.mjs#L503); [test/example](test/test.mjs#L2480).\n\nSimilar to [`Array.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values).\n  * Iterable may be [#nil](#function-isnil), equivalent to `[]`.\n  * Always creates a new array. Does not mutate the input.\n\n### `function index`\n\nLinks: [source](fpx.mjs#L505); [test/example](test/test.mjs#L2498).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e Key | any) =\u003e {[Key: A]}`.\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and returns an index where its values are _keyed_ by the given function, hence the name. The function is called for each value. If the function returns a [#valid key](#function-iskey), the key-value pair is added to the index. Invalid keys are ignored. If the function returns the same key for multiple values, previous values are lost.\n\nSimilar to Lodash's `_.keyBy`. Compare [#`group`](#function-group) which keeps all values for each group, rather than only the last.\n\n### `function group`\n\nLinks: [source](fpx.mjs#L515); [test/example](test/test.mjs#L2543).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e Key | any) =\u003e {[Key: A[]]}`.\n\nTakes an arbitrary iterable compatible with [#`values`](#function-values) and groups its values by keys generated by the given function. The function is called for each value. If the function returns a [#valid key](#function-iskey), the value is added to the index under that key. Invalid keys are ignored.\n\nCompare [#`index`](#function-index), which keeps only the last value for each group.\n\n### `function partition`\n\nLinks: [source](fpx.mjs#L525); [test/example](test/test.mjs#L2569).\n\nSignature: `(Iter\u003cA\u003e, A =\u003e bool) =\u003e [A[], A[]]`.\n\nPartitions the [#`values`](#function-values) of a given iterable, returning a tuple of two groups: values that satisfy the predicate and the remainder.\n\n### `function sum`\n\nLinks: [source](fpx.mjs#L533); [test/example](test/test.mjs#L2586).\n\nSignature: `(Iter\u003cA\u003e) =\u003e fin`.\n\nSums all finite [#`values`](#function-values) of an arbitrary iterable, ignoring all non-finite values.\n\n### `function zip`\n\nLinks: [source](fpx.mjs#L538); [test/example](test/test.mjs#L2597).\n\nSignature: `(Iter\u003c[Key, A]\u003e) =\u003e {[Key: A]}`.\n\nSimilar to [`Object.fromEntries`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries). Differences:\n\n  * Takes an arbitrary iterable compatible with [#`values`](#function-values) (more flexible).\n    * Each value of this iterable must be a key-value pair.\n  * Ignores entries where the first element is not a [#valid key](#function-iskey).\n  * Returns a [#null-prototype object](#function-npo).\n  * Slightly slower.\n\n### `function mapFrom`\n\nLinks: [source](fpx.mjs#L544); [test/example](test/test.mjs#L2614).\n\nSyntactic shortcut for creating a `Map` with inline keys and values. Shorter and less noisy than either `new Map` with an array of entries or chained `.set` calls.\n\n### `function range`\n\nLinks: [source](fpx.mjs#L551); [test/example](test/test.mjs#L2621).\n\nSignature: `(min: int, max: int) =\u003e int[]`.\n\nReturns an array of contiguous integers in the range of `[min, max)`. The first value is `min`, the last value is `max - 1`.\n\n### `function span`\n\nLinks: [source](fpx.mjs#L562); [test/example](test/test.mjs#L2636).\n\nSignature: `nat =\u003e nat[]`.\n\nReturns an array of the given length, where values are integers from 0. Shortcut for `f.range(0, length)`. Nil length is equivalent to 0.\n\n### `function times`\n\nLinks: [source](fpx.mjs#L563); [test/example](test/test.mjs#L2647).\n\nSignature: `(len: nat, fun: nat =\u003e A) =\u003e A[]`.\n\nTakes an array length and a mapping function. Returns an array of the given length, where each element is the result of calling the given function, passing the element's index, starting with 0. Equivalent to `f.mapMut(f.span(len), fun)`.\n\n### `function repeat`\n\nLinks: [source](fpx.mjs#L564); [test/example](test/test.mjs#L2668).\n\nSignature: `(len: nat, val: A) =\u003e A[]`.\n\nReturns an array of the given length where each element is the given value. Equivalent to `f.alloc(len).fill(val)`.\n\n### `function set`\n\nLinks: [source](fpx.mjs#L565); [test/example](test/test.mjs#L2680).\n\nConverts an arbitrary input to a native [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set). Similar to `new Set`. Differences:\n\n  * If input is already a set: **return as-is without copying**.\n  * Otherwise, create a set of the input's [#`values`](#function-values).\n    * [#Maps](#function-ismap) and [#structs](#function-isstruct) are treated as collections of their values rather than key-value entries.\n\n### `function setCopy`\n\nLinks: [source](fpx.mjs#L566); [test/example](test/test.mjs#L2704).\n\nSimilar to [#`set`](#function-set): converts an arbitrary input to a set. Difference: always makes a copy. If the original was a set, it's unaffected by mutations of the output.\n\n\n## License\n\nhttps://unlicense.org\n\n## Misc\n\nI'm receptive to suggestions. If this library _almost_ satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Ffpx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitranim%2Ffpx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Ffpx/lists"}