Arare
Lightweight curried functional programming library
Install / Use
/learn @klaudiosinani/ArareREADME
Description
Lightweight and without any external dependencies arare enables you to write tacit, point-free, declarative & clean code while avoiding side-effects and mutations. Internally the library itself, comprised of over 200 functions, follows the functional programming paradigm and is materialized using fundamental functional qualities such as currying, recursion, tail calls, high-order functions, referential transparency, side-effects elimination and function composition. Additionally, arare utilizes automatic variadic currying for its functions, thus allowing the user to write more flexible, practical & minimal code, compared to regular strict currying. Finally, the library comes with a build-in interactive REPL environment, useful for directly inspecting and experimenting with all available modules without leaving the console.
Highlights
- Over 200 available functions
- Build-in interactive REPL
- Point-free & tacit
- High-order & pure functions
- Automatic variadic currying
- Declarative & minimal syntax
- Side-effects & mutations free
- Lightweight with zero dependencies
- Build with functional code
- Actively developed
Contents
Install
npm install arare
Usage
Import arare and start using directly any of the available modules.
const A = require('arare')
A.map(A.add(10), A.range(1, 4, 1))
//=> [11, 12, 13]
Alternatively, select and import only the modules that you need.
const {add, map, range} = require('arare')
map(add(10), range(1, 4, 1))
//=> [11, 12, 13]
REPL
Initially, install arare globally in order to be able to access the REPL environment.
npm install -g arare
To launch the REPL simply type arare from anywhere in your console.
arare # launch REPL
<div align="center">
<img alt="REPL" width="85%" src="media/repl.png"/>
</div>
API
The following lists contain all available functions grouped into categories according to the type of their respective returning value.
An alphabetically ordered list of all available functions can be found here.
Any
<details>
<summary>Functions whose return value <b>varies</b> according to their input.</summary>
<br/>
<br/>
</details>
Array
<details>
<summary>Functions whose return value is an <b>array</b>.</summary>
<br/>
appendappendToarrayarrayifyarrayMinMaxbreakWhenconcatcopydropdropRightdropRightWhiledropWhileemptyentrieseraseFsfillfilterflattenhalveinitinsertkeysmapmapcatmergemergeByonespairpartitionpartitionAtprependprependTopropsrangerejectremoveremoveAllremoveRightreplace#replaceAllx-rep-xsreversesetHeadsetHeadWithsetLastsetLastWithsetNthsetNthWithshiftshiftLeftslicesplitswapTstailtaketakeRighttakeRightWhiletakeWhilevaluesxshiftxshiftLeftzeroszipzipReversezipSelfzipTailzipWith
Boolean
<details>
<summary>Functions whose return value is a <b>boolean</b>.</summary>
<br/>
andboolendsWitheqeqPropeveneveryexcludesFgtgtehasPropincludesisArrisDateisDefisEmptyisFnisIntisLowerisNegisNilisNullisNumisObjisPairisPosisRegExpisStrisUndefisUpperltltenandnonenornotnotArrnotDatenotEmptynotFnnotIntnotLowernotNilnotNullnotNumnotObjnotPairnotRegExpnotStrnotUpperoddorsomestartsWithTunequneqPropxnorxor
Function
<details>
<summary>Functions whose return value is a <b>function</b>.</summary>
<br/>
aritybinarycompconscurryflipgathernullarypartialpartialRightpipereverseArgsspreadternaryunaryxarrayxcurry
Number
<details>
<summary> Functions whose return value is a <b>number</b>.</summary>
<br/>
Related Skills
node-connect
348.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
