arare
arare copied to clipboard
Lightweight curried functional programming library
Arare
Lightweight auto-curried functional programming library

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.
Please note that project is in its early days and that it is currently under active development.
Come over to Gitter or Twitter to share your thoughts on the project.
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
- Description
- Highlights
- Install
- Usage
- REPL
- API
- Development
- Team
- License
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

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
Functions whose return value varies according to their input.
-
apply
-
applyArgs
-
ext
-
find
-
getNth
-
head
-
id
-
ite
-
last
-
reduce
-
reduceRight
-
snd
-
startsWith
-
trd
-
xapply
Array
Functions whose return value is an array.
-
append
-
appendTo
-
array
-
arrayify
-
arrayMinMax
-
breakWhen
-
concat
-
copy
-
drop
-
dropRight
-
dropRightWhile
-
dropWhile
-
empty
-
entries
-
erase
-
Fs
-
fill
-
filter
-
flatten
-
halve
-
init
-
insert
-
keys
-
map
-
mapcat
-
merge
-
mergeBy
-
ones
-
pair
-
partition
-
partitionAt
-
prepend
-
prependTo
-
props
-
range
-
reject
-
remove
-
removeAll
-
removeRight
-
replace
-
#replaceAllx-rep-xs
-
reverse
-
setHead
-
setHeadWith
-
setLast
-
setLastWith
-
setNth
-
setNthWith
-
shift
-
shiftLeft
-
slice
-
split
-
swap
-
Ts
-
tail
-
take
-
takeRight
-
takeRightWhile
-
takeWhile
-
values
-
xshift
-
xshiftLeft
-
zeros
-
zip
-
zipReverse
-
zipSelf
-
zipTail
-
zipWith
Boolean
Functions whose return value is a boolean.
-
and
-
bool
-
endsWith
-
eq
-
eqProp
-
even
-
every
-
excludes
-
F
-
gt
-
gte
-
hasProp
-
includes
-
isArr
-
isDate
-
isDef
-
isEmpty
-
isFn
-
isInt
-
isLower
-
isNeg
-
isNil
-
isNull
-
isNum
-
isObj
-
isPair
-
isPos
-
isRegExp
-
isStr
-
isUndef
-
isUpper
-
lt
-
lte
-
nand
-
none
-
nor
-
not
-
notArr
-
notDate
-
notEmpty
-
notFn
-
notInt
-
notLower
-
notNil
-
notNull
-
notNum
-
notObj
-
notPair
-
notRegExp
-
notStr
-
notUpper
-
odd
-
or
-
some
-
startsWith
-
T
-
uneq
-
uneqProp
-
xnor
-
xor
Function
Functions whose return value is a function.
-
arity
-
binary
-
comp
-
cons
-
curry
-
flip
-
gather
-
nullary
-
partial
-
partialRight
-
pipe
-
reverseArgs
-
spread
-
ternary
-
unary
-
xarray
-
xcurry
Number
Functions whose return value is a number.
-
abs
-
absDiff
-
add
-
adjustIndex
-
arrayMax
-
arrayMin
-
ceil
-
count
-
cube
-
decr
-
div
-
fact
-
findIndex
-
gcd
-
incr
-
lcm
-
len
-
max
-
min
-
minMax
-
mod
-
mult
-
neg
-
num
-
one
-
pow
-
prod
-
recip
-
square
-
sub
-
sum
-
trunc
-
zero
String
Functions whose return value is a string.
-
append
-
appendTo
-
breakWhen
-
concat
-
drop
-
dropRight
-
dropRightWhile
-
dropWhile
-
empty
-
erase
-
halve
-
init
-
insert
-
join
-
partition
-
partitionAt
-
prepend
-
prependTo
-
remove
-
remove
-
remove
-
replace
-
#replaceAllx-rep-xs
-
reverse
-
setHead
-
setHeadWith
-
setLast
-
setLastWith
-
setNth
-
setNthWith
-
shift
-
shiftLeft
-
slice
-
str
-
swap
-
tail
-
take
-
takeRight
-
takeRightWhile
-
takeWhile
-
toLower
-
toUpper
-
xshift
-
xshiftLeft
Object
Functions whose return value is a plain object.
-
assign
-
assignWith
-
copy
-
countAll
-
countBy
-
countIn
-
zipObj
Undefined
Functions whose return value is undefined.
-
forEach
Development
- Fork the repository and clone it to your machine
- Navigate to your local fork:
cd arare
- Install the project dependencies:
npm install
oryarn install
- Lint the code and run the tests:
npm test
oryarn test
Team
- Klaus Sinani (@klaussinani)