Skip to main content

Library Equivalence Tables

This document provides comparison tables between Pithos modules and their equivalents in popular libraries. The comparisons are organized into three categories:

  1. Utilities: General-purpose utility functions (Lodash, Es-toolkit, Remeda, Radashi, Ramda)
  2. Validation: Schema validation libraries (Zod, Valibot, ArkType, Yup)
  3. Error Handling: Functional error handling patterns (neverthrow, fp-ts, Effect, ts-results)
Disclaimer

The equivalences listed here are indicative only and do not guarantee compatibility or interchangeability between libraries. Each library has its own design philosophy, function signatures, and edge-case behaviors.

Always refer to the documentation of each function before migrating code.

Pithos Coverage

Pithos does not aim to cover 100% of utilities from each library. Some functions will never be added, including:

  • Functions with a recent native equivalent in JavaScript/TypeScript
  • Mutable functions (Pithos favors immutability)
  • Functions considered too specific or rarely used
  • Advanced FP patterns from Ramda (lenses, transducers, applicatives, etc.): for these, use Ramda or fp-ts directly

Legend

  • = Available in Pithos
  • = Not available in Pithos
  • - = Not available in this library
  • = Approximate equivalent (similar but not identical API/behavior)

Part 1: Utilities

Comparison between Pithos (Arkhe) and utility libraries: Lodash, Es-toolkit, Remeda, Radashi, and Ramda.

Array

PithosLodashES-toolkitRemedaRadashiRamda
chunk_.chunkchunkchunkclustersplitEvery
countBy_.countBycountBycountBycountingcountBy
difference_.differencedifferencedifferencediffdifference
drop_.dropdropdrop-drop
dropRight_.dropRightdropRightdropLast-dropLast
dropRightWhile_.dropRightWhiledropRightWhiledropLastWhile-dropLastWhile
dropWhile_.dropWhiledropWhiledropWhile-dropWhile
each_.forEachforEachforEach-forEach
fill_.fillfill---
filter_.filterfilterfilter-filter
findBest--firstByboil-
findLast_.findLastfindLastfindLast-findLast
findLastIndex_.findLastIndexfindLastIndexfindLastIndex-findLastIndex
flatMap_.flatMapflatMapflatMap-chain
flatMapDeep_.flatMapDeepflatMapDeep---
groupBy_.groupBygroupBygroupBygroupgroupBy
includes_.includesincludes--includes
intersection_.intersectionintersectionintersectionintersectsintersection
keyBy_.keyBykeyByindexByobjectifyindexBy
maxBy_.maxBymaxBy-maxmaxBy
minBy_.minByminBy-minminBy
orderBy_.orderByorderBysortBysortsortWith
partition_.partitionpartitionpartitionforkpartition
reduce_.reducereducereduce-reduce
reduceRight_.reduceRightreduceRight--reduceRight
reject_.rejectreject--reject
reverse_.reversereversereverse-reverse
sample_.samplesamplesampledraw-
sampleSize_.sampleSizesampleSizesample--
shuffle_.shuffleshuffleshuffleshuffle-
size_.sizesizelength-length
sortBy_.sortBysortBysortBysortsortBy
take_.taketaketake-take
takeRight_.takeRighttakeRighttakeLast-takeLast
takeRightWhile_.takeRightWhiletakeRightWhiletakeLastWhile-takeLastWhile
takeWhile_.takeWhiletakeWhiletakeWhile-takeWhile
union_.unionunion-uniqueunion
uniq_.uniquniquniqueuniqueuniq
uniqBy_.uniqByuniqByuniqueByuniqueuniqBy
unzip_.unzipunzip-unziptranspose
window-windowed--aperture
xor / toggle_.xorxor-togglesymmetricDifference
zip_.zipzipzipzipzip
zipWith_.zipWithzipWithzipWithzipzipWith
---dropFirstBy--
---hasAtLeast--
---splitAt-splitAt
---splitWhen-splitWhen
---takeFirstBy--
-----dropRepeats
-----dropRepeatsWith
-----splitEvery
-_.xorByxorBy---
-_.xorWithxorWith--symmetricDifferenceWith

Function

PithosLodashEs-toolkitRemedaRadashiRamda
after_.afterafter---
before_.beforebefore---
castComparator---castComparatorcomparator
castMapping_.iteratee--castMapping-
constant_.constantconstantconstant-always
curry_.currycurry--curry
debounce_.debouncedebouncedebouncedebounce-
flip_.flipflip-flipflip
flow / pipe_.flowflowpipechainpipe
flowRight_.flowRightflowRight-composecompose
identity_.identityidentityidentityidentityidentity
memoize_.memoizememoize-memomemoizeWith
negate_.negatenegate--complement
noop_.noopnoopdoNothingnoop-
once_.onceonceonceonceonce
tap_.tap-tap-tap
throttle_.throttlethrottle-throttle-
times_.timestimestimesiteratetimes
-----ascend
-----descend

Lang (Type Checks)

PithosLodashEs-toolkitRemedaRadashiRamda
castArray / toArray_.castArraycastArray-castArray-
cloneDeep / deepClone_.cloneDeepcloneDeepclonecloneDeepclone
isArray_.isArrayisArrayisArrayisArrayis(Array)
isBigint--isBigIntisBigInt-
isBoolean_.isBooleanisBooleanisBooleanisBooleanis(Boolean)
isDate_.isDateisDateisDateisDateis(Date)
isDefined--isDefined--
isEmpty_.isEmptyisEmptyisEmptyisEmptyisEmpty
isEqual_.isEqualisEqualisDeepEqualisEqualequals
isError_.isErrorisErrorisErrorisError-
isFloat---isFloat-
isFunction_.isFunctionisFunctionisFunctionisFunctionis(Function)
isMap_.isMapisMap-isMapis(Map)
isNil_.isNilisNilisNullishisNullishisNil
isNonNull--isNonNull-isNotNil
isNonNullable--isNonNullish-isNotNil
isNonUndefined--isDefined--
isNull_.isNullisNull---
isNumber_.isNumberisNumberisNumberisNumberis(Number)
isObject_.isObjectisObjectisObjectTypeisObjectis(Object)
isOneOf--isIncludedIn--
isPlainObject_.isPlainObjectisPlainObjectisPlainObjectisPlainObject-
isPrimitive-isPrimitive-isPrimitive-
isPromise-isPromiseisPromiseisPromise-
isRegExp_.isRegExpisRegExp-isRegExpis(RegExp)
isSet_.isSetisSet-isSetis(Set)
isString_.isStringisStringisStringisStringis(String)
isUndefined_.isUndefinedisUndefined-isUndefined-
---isEmptyish--
---isNot--
---isShallowEqual--
---isStrictEqual--
---isTruthy--
-----identical
-----type
-_.cloneclone-cloneclone
-_.cloneDeepWithcloneDeepWith---
-_.isEqualWithisEqualWith---
-_.isLengthisLength---
-----isNotEmpty

Math / Number

PithosLodashEs-toolkitRemedaRadashiRamda
average_.meanmeanmean-mean
clamp_.clampclampclampclampclamp
inRange_.inRangeinRange-inRange-
maxBy_.maxBymaxBy-maxmaxBy
median-medianmedian-median
minBy_.minByminBy-minminBy
random_.randomrandomrandomIntegerrandom-
range_.rangerangerangerangerange
sum_.sumsumsumsumsum
---product-product
-_.sumBysumBysumBy--
-_.meanBymeanBymeanBy--
--medianBy---
-_.rangeRightrangeRight---

Object

PithosLodashEs-toolkitRemedaRadashiRamda
defaults_.defaultsdefaults--mergeLeft
defaultsDeep_.defaultsDeepdefaultsDeep--mergeDeepLeft
deepClone_.cloneDeepcloneDeepclonecloneDeepclone
evolve--evolve-evolve
findKey_.findKeyfindKey---
get_.getgetpathOr / propgetpath
has_.hashas--has
invert_.invertinvertinvertinvertinvert
mapKeys_.mapKeysmapKeysmapKeysmapKeysmapKeys
mapValues_.mapValuesmapValuesmapValuesmapValuesmapObjIndexed
mergeDeep_.mergemergemergeDeep-mergeDeepRight
omit_.omitomitomitomitomit
omitBy_.omitByomitByomitByfilterKey-
pick_.pickpickpickpickpick
pickBy_.pickBypickBypickByfilterKeypickBy
set_.setsetset / setPathsetassocPath
---mergeAll-mergeAll
-----dissoc
-----dissocPath
-----pathOr
-----propOr
-----hasPath
-----renameKeys
-_.cloneclone-cloneclone

String

PithosLodashEs-toolkitRemedaRadashiRamda
camelCase_.camelCasecamelCasetoCamelCasecamel-
capitalize_.capitalizecapitalizecapitalizecapitalize-
constantCase-constantCase---
deburr_.deburrdeburr---
escape_.escapeescape-escapeHTML-
escapeRegExp_.escapeRegExpescapeRegExp---
kebabCase_.kebabCasekebabCasetoKebabCasedash-
lowerFirst_.lowerFirstlowerFirstuncapitalize--
pascalCase-pascalCase-pascal-
sentenceCase-----
snakeCase_.snakeCasesnakeCasetoSnakeCasesnake-
template_.templatetemplate-template-
titleCase--toTitleCasetitle-
truncate_.truncatetruncatetruncate--
unescape_.unescapeunescape---
words_.wordswords---
---randomString--
-_.startCasestartCase---

Async / Promise

PithosLodashEs-toolkitRemedaRadashiRamda
all---all-
dedupeByKey-----
guard---guard-
parallel---parallel-
queueByKey---queueByKey-
retry-retry-retry-
sleep_.delaydelay-sleep-
timeout-timeout-timeout-
tryCatch_.attemptattempt-tryittryCatch
--withTimeout---

Util

PithosLodashEs-toolkitRemedaRadashiRamda
assert-assert-assert-
castMapping_.iteratee--castMapping-
defaultTo_.defaultTodefaultTodefaultTo-defaultTo
noop_.noopnoopdoNothingnoop-
range_.rangerangerangerangerange
times_.timestimestimesiteratetimes
uniqueId_.uniqueIduniqueId-uid-
---sortedIndex--
---sortedIndexBy--
---sortedIndexWith--
---sortedLastIndex--
---sortedLastIndexBy--
-_.attemptattempt-tryit-
--invariant---

Part 2: Validation

Comparison between Pithos (Kanon) and schema validation libraries: Zod, Valibot, ArkType, and Yup.

note

Kanon is Pithos's validation module, designed for maximum tree-shaking and minimal bundle size. Unlike class-based validators, Kanon uses pure functions that can be individually imported.

Pithos (Kanon)ZodValibotArkTypeYup
stringz.string()v.string()type("string")yup.string()
numberz.number()v.number()type("number")yup.number()
booleanz.boolean()v.boolean()type("boolean")yup.boolean()
bigintz.bigint()v.bigint()type("bigint")-
datez.date()v.date()type("Date")yup.date()
symbolz.symbol()v.symbol()type("symbol")-
undefinedz.undefined()v.undefined()type("undefined")-
nullz.null()v.null()type("null")-
voidz.void()v.void()type("void")-
anyz.any()v.any()type("unknown")yup.mixed()
unknownz.unknown()v.unknown()type("unknown")yup.mixed()
neverz.never()v.never()type("never")-
literalz.literal()v.literal()type("'value'")-
objectz.object()v.object()type({})yup.object()
arrayz.array()v.array()type("T[]")yup.array()
tuplez.tuple()v.tuple()type(["T", "U"])yup.tuple()
unionz.union()v.union()type("T|U")-
discriminatedUnionz.discriminatedUnion()v.variant()--
intersectionz.intersection()v.intersect()type("T&U")-
recordz.record()v.record()type("Record<K,V>")-
mapz.map()v.map()--
setz.set()v.set()--
enumz.enum()v.enum()type("'a'|'b'")-
nativeEnumz.nativeEnum()v.enum()--
optional.optional()v.optional()type("T?").optional()
nullable.nullable()v.nullable()type("T|null").nullable()
nullish.nullish()v.nullish()--
default.default()v.optional(_, default)-.default()
catch.catch()v.fallback()--
transform.transform()v.transform().pipe().transform()
refine.refine()v.check().narrow().test()
superRefine.superRefine()v.rawCheck()--
pipe.pipe()v.pipe().pipe()-
coercez.coerce.*v.pipe(v.unknown(), v.transform())--
parse.parse()v.parse()type().validateSync()
safeParse.safeParse()v.safeParse()--
parseAsync.parseAsync()v.parseAsync()-.validate()
safeParseAsync.safeParseAsync()v.safeParseAsync()--
brand.brand()v.brand()--
readonly.readonly()v.readonly()--
lazyz.lazy()v.lazy()-yup.lazy()
promisez.promise()---
functionz.function()v.function()--
instanceofz.instanceof()v.instance()type("instanceof X")-
preprocessz.preprocess()v.pipe()--
customz.custom()v.custom()--

Part 3: Error Handling

Comparison between Pithos (Zygos) and functional error handling libraries: neverthrow, fp-ts, Effect, and ts-results.

About Effect

Effect is a comprehensive functional programming ecosystem, not just an error handling library. It includes its own runtime, dependency injection, concurrency primitives, and much more. We compare only the error handling primitives here (Option, Either, Effect).

Option / Maybe

Pithos (Zygos)fp-tsEffectneverthrowts-results
Option<A>Option<A>Option<A>-Option<T>
Some<A>Some<A>Some<A>-Some<T>
NoneNoneNone-None
some(a)O.some(a)Option.some(a)-Some(a)
noneO.noneOption.none()-None
isSomeO.isSomeOption.isSome-.some
isNoneO.isNoneOption.isNone-.none
fromNullableO.fromNullableOption.fromNullable--
fromPredicateO.fromPredicateOption.filter--
mapO.mapOption.map-.map()
flatMap / chainO.flatMap / O.chainOption.flatMap-.andThen()
match / foldO.match / O.foldOption.match-.match()
getOrElseO.getOrElseOption.getOrElse-.unwrapOr()
orElse / altO.orElse / O.altOption.orElse-.or()
filterO.filterOption.filter--
toNullableO.toNullableOption.getOrNull--
toUndefinedO.toUndefinedOption.getOrUndefined--
flattenO.flattenOption.flatten--
tryCatchO.tryCatchOption.liftThrowable--

Either / Result

Pithos (Zygos)fp-tsEffectneverthrowts-results
Either<E, A>Either<E, A>Either<L, R>--
Result<T, E>-Exit<A, E>Result<T, E>Result<T, E>
Left<E> / ErrLeft<E>Either.leftErr<E>Err<E>
Right<A> / OkRight<A>Either.rightOk<T>Ok<T>
left(e) / err(e)E.left(e)Either.left(e)err(e)Err(e)
right(a) / ok(a)E.right(a)Either.right(a)ok(a)Ok(a)
isLeft / isErrE.isLeftEither.isLeft.isErr().err
isRight / isOkE.isRightEither.isRight.isOk().ok
mapE.mapEither.map.map().map()
mapLeft / mapErrE.mapLeftEither.mapLeft.mapErr().mapErr()
flatMap / andThenE.flatMap / E.chainEither.flatMap.andThen().andThen()
match / foldE.match / E.foldEither.match.match().match()
getOrElseE.getOrElseEither.getOrElse.unwrapOr().unwrapOr()
orElseE.orElseEither.orElse.orElse().or()
fromNullableE.fromNullable---
fromPredicateE.fromPredicate---
tryCatchE.tryCatchEffect.tryResult.fromThrowable-
fromOptionE.fromOption---
toUnionE.toUnionEither.merge--
swapE.swapEither.flip--
filterOrElseE.filterOrElse---
Do notationE.DoEffect.gen--
bindE.bind---
apSE.apS---

Task / Async

Pithos (Zygos)fp-tsEffectneverthrowts-results
Task<A>Task<A>Effect<A>--
TaskEither<E, A>TaskEither<E, A>Effect<A, E>--
ResultAsync<T, E>-Effect<A, E>ResultAsync<T, E>ResultAsync<T, E>
okAsync(a)TE.right(a)Effect.succeed(a)okAsync(a)-
errAsync(e)TE.left(e)Effect.fail(e)errAsync(e)-
fromPromiseTE.tryCatchEffect.tryPromiseResultAsync.fromPromise-
fromSafePromiseT.fromIOEffect.promiseResultAsync.fromSafePromise-
map (async)TE.mapEffect.map.map()-
mapErr (async)TE.mapLeftEffect.mapError.mapErr()-
andThen (async)TE.flatMap / TE.chainEffect.flatMap.andThen()-
match (async)TE.match / TE.foldEffect.match.match()-
unwrapOr (async)TE.getOrElseEffect.orElseSucceed.unwrapOr()-
combineA.sequence(TE.ApplicativePar)Effect.allResult.combine-
safeTry-Effect.gensafeTry-

Detailed Comparisons