As compared to Ramda
fp-ts-std attempts to bridge the gap between fp-ts, a highly abstract library, and libraries like Ramda, which are focused on providing utility functions.
Here’s the status of all of Ramda’s functions (as of Ramda v0.27.0) being potentially implemented in fp-ts-std.
Note that some functions are not one-to-one replacements, but rather bequeath a better pattern in code. For example, the Ramda function hasIn is distinct from has only insofar as it checks the input object’s prototype for the specified key, too. Prototypal code isn’t functional and not something this library intends to support; instead, look for functional alternatives.
[ ] __Use currying and potentially fp-ts-std/Function::flip instead.- add - fp-ts-std/Number::add/fp-ts/Field
- addIndex - fp-ts-std/Function::withIndex
- adjust - fp-ts/Array::modifyAt
- all - fp-ts/Array::every
- allPass - fp-ts-std/Predicate::allPass
- always - fp-ts/function::constant
- and - fp-ts-std/Boolean::and/fp-ts/Semigroup::semigroupAll
- andThen - fp-ts/Task::map
- any - fp-ts/Array::some
- anyPass - fp-ts-std/Predicate::anyPass
- ap - fp-ts/Array::ap
- aperture - fp-ts-std/Array::aperture
- append - fp-ts/Array::snoc
- apply - fp-ts-std/Function::unary
- applySpec - monocle-ts
- applyTo - fp-ts/function::apply
- ascend - fp-ts/Ord::contramap
- assoc - monocle-ts
- assocPath - monocle-ts
[ ] binaryUse currying and potentially fp-ts-std/Function::unary instead.[ ] bindDo not usethis
.- both - fp-ts-std/Boolean::and/fp-ts/Option::apFirst
[ ] callUse currying.- chain - fp-ts/Array::chain
- clamp - fp-ts/Ord::clamp
[ ] cloneAvoid mutation.- comparator - fp-ts/Ord::fromCompare
- complement - fp-ts/Predicate::not
- compose
- composeK
- composeP
[ ] composeWithUtilise functors like fp-ts/Option instead.- concat - fp-ts/Array::getMonoid/fp-ts-std/String::concat
- cond - fp-ts-std/Function::guard
- construct - fp-ts-std/Function::construct
- constructN - fp-ts-std/Function::construct w/ fp-ts-std/Function::curry2T through fp-ts-std/Function::curry5T
- contains - fp-ts/Array::elem/fp-ts/string::includes
- converge - fp-ts-std/Function::converge
- countBy - fp-ts-std/Array::countBy
- curry - fp-ts-std/Function::curry2 through fp-ts-std/Function::curry5
- curryN - fp-ts-std/Function::curry2 through fp-ts-std/Function::curry5
- dec - fp-ts-std/Number::decrement/[fp-ts/function::decrement](https://gcanti.github.io/fp-ts/modules/function.ts.html#decrement]
- defaultTo - fp-ts/Option::getOrElse
- descend - fp-ts/Ord::ordNumber/fp-ts/Ord::getDualOrd
- difference - fp-ts/Array::difference
- differenceWith - fp-ts/Array::difference
- dissoc - fp-ts-std/Record::omit
- dissocPath
- divide - fp-ts-std/Number::divide/fp-ts/Field
- drop - fp-ts/Array::dropLeft/fp-ts-std/String::dropLeft
- dropLast - fp-ts/Array::dropRight/fp-ts-std/String::dropRight
- dropLastWhile - fp-ts-std/Array::dropRightWhile/fp-ts-std/String::dropRightWhile
- dropRepeats - fp-ts-std/Array::dropRepeats
- dropRepeatsWith - fp-ts-std/Array::dropRepeats
- dropWhile - fp-ts/Array::dropLeftWhile/fp-ts-std/String::dropLeftWhile
- either - fp-ts-std/Boolean::or/fp-ts/Option::alt
- empty - fp-ts/Array::empty/fp-ts/Record::empty/[fp-ts/Option::empty]/fp-ts/string::empty
- endsWith - fp-ts-std/Array::endsWith/fp-ts/string::endsWith
- eqBy - fp-ts/Eq::contramap
- eqProps - fp-ts/Eq::contramap
- equals - fp-ts/Eq
- evolve - fp-ts/struct::evolve
- F - fp-ts/function::constFalse
- filter - fp-ts/Array::filter/fp-ts/Record::filter
- find - fp-ts/Array::findFirst
- findIndex - fp-ts/Array::findIndex
- findLast - fp-ts/Array::findLast
- findLastIndex - fp-ts/Array::findLastIndex
- flatten - fp-ts/Array::flatten
- flip - fp-ts-std/Function::flip
[ ] forEachUse functormap
instead.[ ] forEachObjIndexedUse functormap
instead.- fromPairs - fp-ts/Record::fromFoldable
- groupBy - fp-ts/NonEmptyArray::groupBy
- groupWith - fp-ts/NonEmptyArray::group
- gt - fp-ts/Ord::gt
- gte - fp-ts/Ord::geq
- has - fp-ts/Record::hasOwnProperty
- hasIn - fp-ts/Record::hasOwnProperty
- hasPath - monocle-ts
- head - fp-ts/Array::head / fp-ts-std/String::head
- identical - fp-ts/Eq::eqStrict
- identity - fp-ts/function::identity
- ifElse - fp-ts-std/Function::ifElse
- inc - fp-ts-std/Number::increment/[fp-ts/function::increment](https://gcanti.github.io/fp-ts/modules/function.ts.html#increment]
- includes - fp-ts/Array::elem
- indexBy - fp-ts/NonEmptyArray::groupBy
- indexOf - fp-ts/Array::indexOf
- init - fp-ts/Array::init/fp-ts-std/String::init
[ ] innerJoinThis function has a misleading name. It can be trivially rewritten withA.some
insideA.filter
with each acting upon different arrays.- insert - fp-ts/Array::insertAt
- insertAll - fp-ts-std/Array::insertMany
- intersection - fp-ts/Array::intersection
- intersperse - fp-ts/Array::intersperse
- into
- invert - fp-ts-std/Record::invertAll
- invertObj - fp-ts-std/Record::invertLast
- invoker - fp-ts-std/Function::invoke
- is - io-ts / fp-ts-std/Function::isInstanceOf
- isEmpty - fp-ts/Array::isEmpty/fp-ts/Record::isEmpty/fp-ts/string::isEmpty
[ ] isNilPreferOption
type. Failing that, createEq
instances fornull
andundefined
.- join - fp-ts-std/Array::join
- juxt - fp-ts-std/Function::fork
- keys - fp-ts/Record::keys
- keysIn - fp-ts/Record::keys
- last - fp-ts/Array::last/fp-ts-std/String::last
- lastIndexOf - fp-ts/Array::lastIndexOf
- length - fp-ts/Array::size
- lens - monocle-ts
- lensIndex - monocle-ts
- lensPath - monocle-ts
- lensProp - monocle-ts
- lift - fp-ts/Array::ap
- liftN - fp-ts/Array::ap
- lt - fp-ts/Ord::lt
- lte - fp-ts/Ord::leq
- map - fp-ts/Array::map
- mapAccum - fp-ts/Array::scanLeft
- mapAccumRight - fp-ts/Array::scanRight
- mapObjIndexed - fp-ts/Record::mapWithIndex
- match - fp-ts-std/String::match/fp-ts-contrib/RegExp::match
- mathMod - fp-ts-std/Number::mod
- max - fp-ts/Ord::max
- maxBy - fp-ts/Ord::max w/ fp-ts/Ord::contramap
- mean - fp-ts-std/Array::mean
- median - fp-ts-std/Array::median
- memoizeWith - fp-ts-std/Function::memoize
- merge - fp-ts/Record::getMonoid
- mergeAll - fp-ts-std/Record::merge/fp-ts/Record::getMonoid
- mergeDeepLeft - fp-ts/Record::getMonoid
- mergeDeepRight - fp-ts/Record::getMonoid
- mergeDeepWith - fp-ts/Record::getMonoid
- mergeDeepWithKey - fp-ts/Record::getMonoid
- mergeLeft - fp-ts/Record::getMonoid
- mergeRight - fp-ts/Record::getMonoid
- mergeWith - fp-ts/Record::getMonoid
- mergeWithKey - fp-ts/Record::getMonoid
- min - fp-ts/Ord::min
- minBy - fp-ts/Ord::min w/ fp-ts/Ord::contramap
- modulo - fp-ts-std/Number::rem/fp-ts/Field
- move - fp-ts-std/Array::moveFrom/fp-ts/Array::rotate
- multiply - fp-ts-std/Number::multiply/fp-ts/Field
[ ] nAryUse curried functions and avoidundefined
.- negate - fp-ts-std/Number::negate/fp-ts/Ring::negate
- none - fp-ts-std/Array::none
- not - fp-ts-std/Boolean::invert
- nth - fp-ts/Array::lookup/fp-ts-std/String::lookup
[ ] nthArgUse curried functions and constant instead.[ ] oUse flow instead.- objOf - fp-ts/Record::singleton
- of - fp-ts/Array::of
- omit - fp-ts-std/Record::omit
- once - fp-ts-std/IO::once
- or - fp-ts-std/Boolean::or/fp-ts/Semigroup::semigroupAny
- otherwise - fp-ts/Either::getOrElse w/ fp-ts/TaskEither
- over - monocle-ts
- pair - fp-ts/function::tuple
[ ] partialUse currying instead.[ ] partialRightUse currying and potentially fp-ts-std/Function::flip instead.- partition - fp-ts/Array::partition
- path - monocle-ts
- pathEq - monocle-ts
- pathOr - monocle-ts
- paths - monocle-ts
- pathSatisfies - monocle-ts
- pick - fp-ts-std/Record::pick
- pickAll
- pickBy - fp-ts/Record::filterWithIndex
- pipe - fp-ts/function::flow
- pipeK - fp-ts/function::flow w/ “K”-appended fp-ts functions such as fp-ts/TaskEither::chainEitherK
- pipeP - fp-ts/function::flow w/ fp-ts/Task
- pipeWith - fp-ts/function::flow w/ monads
- pluck - monocle-ts
- prepend - fp-ts/Array::cons
- product - fp-ts-std/Array::product
[ ] projectUse fp-ts-std/Record::pick in array map instead.- prop - fp-ts/Record::lookup/monocle-ts
- propEq - monocle-ts & fp-ts/Eq
- propIs - io-ts & monocle-ts
- propOr - monocle-ts
- props - monocle-ts
- propSatisfies - monocle-ts
- range - fp-ts/NonEmptyArray::range
- reduce - fp-ts/Array::reduce
- reduceBy - fp-ts/Record::fromFoldableMap
[ ] reducedUse less generalised functions or recursion instead.- reduceRight - fp-ts/Array::reduceRight
- reduceWhile - fp-ts-std/Array::reduceWhile
- reject - fp-ts-std/Array::reject/fp-ts-std/Record::reject
- remove - fp-ts-std/Array::dropAt
- repeat - fp-ts/Array::replicate
- replace - fp-ts/string::replace
- reverse - fp-ts/Array::reverse/fp-ts-std/String::reverse
- scan - fp-ts/Array::scanLeft
- sequence - fp-ts/Array::sequence
- set - monocle-ts
- slice - fp-ts-std/Array::slice/fp-ts/string::slice
- sort - fp-ts/Array::sort
- sortBy - fp-ts/Array::sort
- sortWith - fp-ts/Array::sortBy
- split - fp-ts/string::split
- splitAt - fp-ts/Array::splitAt/fp-ts-std/String::splitAt
- splitEvery - fp-ts/Array::chunksOf
- splitWhen - fp-ts/Array:spanLeft
- startsWith - fp-ts-std/Array::startsWith/fp-ts/string::startsWith
- subtract - fp-ts-std/Number::subtract/fp-ts/Field
- sum - fp-ts-std/Array::sum
- symmetricDifference - fp-ts-std/Array::symmetricDifference
- symmetricDifferenceWith - fp-ts-std/Array::symmetricDifference
- T - fp-ts/function::constTrue
- tail - fp-ts/Array::tail/fp-ts-std/String::tail
- take - fp-ts/Array::takeLeft/fp-ts-std/String::takeLeft
- takeLast - fp-ts/Array::takeRight/fp-ts-std/String::takeLast
- takeLastWhile - fp-ts-std/Array::takeRightWhile/fp-ts-std/String::takeRightWhile
- takeWhile - fp-ts/Array::takeLeftWhile/fp-ts-std/String::takeLeftWhile
- tap - fp-ts-std/IO::tap
- test - fp-ts-std/String::test/fp-ts-contrib/RegExp::test
- thunkify - fp-ts/function::constant
- times - fp-ts/Array::makeBy
- toLower - fp-ts/string::toLowerCase
- toPairs - fp-ts/Record::collect
- toPairsIn - fp-ts/Record::collect
- toString - fp-ts-std/String::fromNumber
- toUpper - fp-ts/string::toUpperCase
- transduce
- transpose - fp-ts-std/Array::transpose
- traverse - fp-ts/Array::traverse
- trim - fp-ts/string::trim
- tryCatch - fp-ts/Either::tryCatch
- type - io-ts
[ ] unapplyUse currying or tuples instead.[ ] unaryUse currying and potentially fp-ts-std/Function::unary instead.- uncurryN - fp-ts-std/Function::uncurry2 through fp-ts-std/Function::uncurry5
- unfold - fp-ts/Array::unfold
- union - fp-ts/Array::union
- unionWith - fp-ts/Array::union
- uniq - fp-ts/Array::uniq
- uniqBy - fp-ts/Array::uniq
- uniqWith - fp-ts/Array::uniq
- unless - fp-ts-std/Function::unless
- unnest - fp-ts/Array::flatten
- until - fp-ts-std/Function::until
- update - fp-ts/Array::updateAt
- useWith
- values - fp-ts-std/Record::values
- valuesIn - fp-ts-std/Record::values
- view - monocle-ts
- when - fp-ts-std/Function::when
- where - fp-ts/Eq
- whereEq - fp-ts/Eq
- without - fp-ts-std/Array::without
- xor - fp-ts-std/Boolean::xor
- xprod - fp-ts-std/Array::cartesian
- zip - fp-ts/Array::zip
- zipObj - fp-ts/Record::fromFoldable
- zipWith - fp-ts/Array::zipWith