Skip to main content

equivalence 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

  • checkmark = Available in Pithos
  • cross = 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
chunkcheckmark_.chunkchunkchunkclustersplitEvery
countBycheckmark_.countBycountBycountBycountingcountBy
differencecheckmark_.differencedifferencedifferencediffdifference
dropcheckmark_.dropdropdrop-drop
dropRightcheckmark_.dropRightdropRightdropLast-dropLast
dropRightWhilecheckmark_.dropRightWhiledropRightWhiledropLastWhile-dropLastWhile
dropWhilecheckmark_.dropWhiledropWhiledropWhile-dropWhile
eachcheckmark_.forEachforEachforEach-forEach
fillcheckmark_.fillfill---
filtercheckmark_.filterfilterfilter-filter
findBestcheckmark--firstByboil-
findLastcheckmark_.findLastfindLastfindLast-findLast
findLastIndexcheckmark_.findLastIndexfindLastIndexfindLastIndex-findLastIndex
flatMapcheckmark_.flatMapflatMapflatMap-chain
flatMapDeepcheckmark_.flatMapDeepflatMapDeep---
groupBycheckmark_.groupBygroupBygroupBygroupgroupBy
includescheckmark_.includesincludes--includes
intersectioncheckmark_.intersectionintersectionintersectionintersectsintersection
keyBycheckmark_.keyBykeyByindexByobjectifyindexBy
maxBycheckmark_.maxBymaxBy-maxmaxBy
minBycheckmark_.minByminBy-minminBy
orderBycheckmark_.orderByorderBysortBysortsortWith
partitioncheckmark_.partitionpartitionpartitionforkpartition
reducecheckmark_.reducereducereduce-reduce
reduceRightcheckmark_.reduceRightreduceRight--reduceRight
rejectcheckmark_.rejectreject--reject
reversecheckmark_.reversereversereverse-reverse
samplecheckmark_.samplesamplesampledraw-
sampleSizecheckmark_.sampleSizesampleSizesample--
shufflecheckmark_.shuffleshuffleshuffleshuffle-
sizecheckmark_.sizesizelength-length
sortBycheckmark_.sortBysortBysortBysortsortBy
takecheckmark_.taketaketake-take
takeRightcheckmark_.takeRighttakeRighttakeLast-takeLast
takeRightWhilecheckmark_.takeRightWhiletakeRightWhiletakeLastWhile-takeLastWhile
takeWhilecheckmark_.takeWhiletakeWhiletakeWhile-takeWhile
unioncheckmark_.unionunion-uniqueunion
uniqcheckmark_.uniquniquniqueuniqueuniq
uniqBycheckmark_.uniqByuniqByuniqueByuniqueuniqBy
unzipcheckmark_.unzipunzip-unziptranspose
windowcheckmark-windowed--aperture
xor / togglecheckmark_.xorxor-togglesymmetricDifference
zipcheckmark_.zipzipzipzipzip
zipWithcheckmark_.zipWithzipWithzipWithzipzipWith
-cross--dropFirstBy--
-cross--hasAtLeast--
-cross--splitAt-splitAt
-cross--splitWhen-splitWhen
-cross--takeFirstBy--
-cross----dropRepeats
-cross----dropRepeatsWith
-cross----splitEvery
-cross_.xorByxorBy---
-cross_.xorWithxorWith--symmetricDifferenceWith

Function

PithosLodashEs-toolkitRemedaRadashiRamda
aftercheckmark_.afterafter---
beforecheckmark_.beforebefore---
castComparatorcheckmark---castComparatorcomparator
castMappingcheckmark_.iteratee--castMapping-
constantcheckmark_.constantconstantconstant-always
currycheckmark_.currycurry--curry
debouncecheckmark_.debouncedebouncedebouncedebounce-
flipcheckmark_.flipflip-flipflip
flow / pipecheckmark_.flowflowpipechainpipe
flowRightcheckmark_.flowRightflowRight-composecompose
identitycheckmark_.identityidentityidentityidentityidentity
memoizecheckmark_.memoizememoize-memomemoizeWith
negatecheckmark_.negatenegate--complement
noopcheckmark_.noopnoopdoNothingnoop-
oncecheckmark_.onceonceonceonceonce
tapcheckmark_.tap-tap-tap
throttlecheckmark_.throttlethrottle-throttle-
timescheckmark_.timestimestimesiteratetimes
-cross----ascend
-cross----descend

Lang (Type Checks)

PithosLodashEs-toolkitRemedaRadashiRamda
castArray / toArraycheckmark_.castArraycastArray-castArray-
cloneDeep / deepClonecheckmark_.cloneDeepcloneDeepclonecloneDeepclone
isArraycheckmark_.isArrayisArrayisArrayisArrayis(Array)
isBigintcheckmark--isBigIntisBigInt-
isBooleancheckmark_.isBooleanisBooleanisBooleanisBooleanis(Boolean)
isDatecheckmark_.isDateisDateisDateisDateis(Date)
isDefinedcheckmark--isDefined--
isEmptycheckmark_.isEmptyisEmptyisEmptyisEmptyisEmpty
isEqualcheckmark_.isEqualisEqualisDeepEqualisEqualequals
isErrorcheckmark_.isErrorisErrorisErrorisError-
isFloatcheckmark---isFloat-
isFunctioncheckmark_.isFunctionisFunctionisFunctionisFunctionis(Function)
isMapcheckmark_.isMapisMap-isMapis(Map)
isNilcheckmark_.isNilisNilisNullishisNullishisNil
isNonNullcheckmark--isNonNull-isNotNil
isNonNullablecheckmark--isNonNullish-isNotNil
isNonUndefinedcheckmark--isDefined--
isNullcheckmark_.isNullisNull---
isNumbercheckmark_.isNumberisNumberisNumberisNumberis(Number)
isObjectcheckmark_.isObjectisObjectisObjectTypeisObjectis(Object)
isOneOfcheckmark--isIncludedIn--
isPlainObjectcheckmark_.isPlainObjectisPlainObjectisPlainObjectisPlainObject-
isPrimitivecheckmark-isPrimitive-isPrimitive-
isPromisecheckmark-isPromiseisPromiseisPromise-
isRegExpcheckmark_.isRegExpisRegExp-isRegExpis(RegExp)
isSetcheckmark_.isSetisSet-isSetis(Set)
isStringcheckmark_.isStringisStringisStringisStringis(String)
isUndefinedcheckmark_.isUndefinedisUndefined-isUndefined-
-cross--isEmptyish--
-cross--isNot--
-cross--isShallowEqual--
-cross--isStrictEqual--
-cross--isTruthy--
-cross----identical
-cross----type
-cross_.cloneclone-cloneclone
-cross_.cloneDeepWithcloneDeepWith---
-cross_.isEqualWithisEqualWith---
-cross_.isLengthisLength---
-cross----isNotEmpty

Math / Number

PithosLodashEs-toolkitRemedaRadashiRamda
averagecheckmark_.meanmeanmean-mean
clampcheckmark_.clampclampclampclampclamp
inRangecheckmark_.inRangeinRange-inRange-
maxBycheckmark_.maxBymaxBy-maxmaxBy
mediancheckmark-medianmedian-median
minBycheckmark_.minByminBy-minminBy
randomcheckmark_.randomrandomrandomIntegerrandom-
rangecheckmark_.rangerangerangerangerange
sumcheckmark_.sumsumsumsumsum
-cross--product-product
-cross_.sumBysumBysumBy--
-cross_.meanBymeanBymeanBy--
-cross-medianBy---
-cross_.rangeRightrangeRight---

Object

PithosLodashEs-toolkitRemedaRadashiRamda
defaultscheckmark_.defaultsdefaults--mergeLeft
defaultsDeepcheckmark_.defaultsDeepdefaultsDeep--mergeDeepLeft
deepClonecheckmark_.cloneDeepcloneDeepclonecloneDeepclone
evolvecheckmark--evolve-evolve
findKeycheckmark_.findKeyfindKey---
getcheckmark_.getgetpathOr / propgetpath
hascheckmark_.hashas--has
invertcheckmark_.invertinvertinvertinvertinvert
mapKeyscheckmark_.mapKeysmapKeysmapKeysmapKeysmapKeys
mapValuescheckmark_.mapValuesmapValuesmapValuesmapValuesmapObjIndexed
mergeDeepcheckmark_.mergemergemergeDeep-mergeDeepRight
omitcheckmark_.omitomitomitomitomit
omitBycheckmark_.omitByomitByomitByfilterKey-
pickcheckmark_.pickpickpickpickpick
pickBycheckmark_.pickBypickBypickByfilterKeypickBy
setcheckmark_.setsetset / setPathsetassocPath
-cross--mergeAll-mergeAll
-cross----dissoc
-cross----dissocPath
-cross----pathOr
-cross----propOr
-cross----hasPath
-cross----renameKeys
-cross_.cloneclone-cloneclone

String

PithosLodashEs-toolkitRemedaRadashiRamda
camelCasecheckmark_.camelCasecamelCasetoCamelCasecamel-
capitalizecheckmark_.capitalizecapitalizecapitalizecapitalize-
constantCasecheckmark-constantCase---
deburrcheckmark_.deburrdeburr---
escapecheckmark_.escapeescape-escapeHTML-
escapeRegExpcheckmark_.escapeRegExpescapeRegExp---
kebabCasecheckmark_.kebabCasekebabCasetoKebabCasedash-
lowerFirstcheckmark_.lowerFirstlowerFirstuncapitalize--
pascalCasecheckmark-pascalCase-pascal-
sentenceCasecheckmark-----
snakeCasecheckmark_.snakeCasesnakeCasetoSnakeCasesnake-
templatecheckmark_.templatetemplate-template-
titleCasecheckmark--toTitleCasetitle-
truncatecheckmark_.truncatetruncatetruncate--
unescapecheckmark_.unescapeunescape---
wordscheckmark_.wordswords---
-cross--randomString--
-cross_.startCasestartCase---

Async / Promise

PithosLodashEs-toolkitRemedaRadashiRamda
allcheckmark---all-
dedupeByKeycheckmark-----
guardcheckmark---guard-
parallelcheckmark---parallel-
queueByKeycheckmark---queueByKey-
retrycheckmark-retry-retry-
sleepcheckmark_.delaydelay-sleep-
timeoutcheckmark-timeout-timeout-
tryCatchcheckmark_.attemptattempt-tryittryCatch
-cross-withTimeout---

Util

PithosLodashEs-toolkitRemedaRadashiRamda
assertcheckmark-assert-assert-
castMappingcheckmark_.iteratee--castMapping-
defaultTocheckmark_.defaultTodefaultTodefaultTo-defaultTo
noopcheckmark_.noopnoopdoNothingnoop-
rangecheckmark_.rangerangerangerangerange
timescheckmark_.timestimestimesiteratetimes
uniqueIdcheckmark_.uniqueIduniqueId-uid-
-cross--sortedIndex--
-cross--sortedIndexBy--
-cross--sortedIndexWith--
-cross--sortedLastIndex--
-cross--sortedLastIndexBy--
-cross_.attemptattempt-tryit-
-cross-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
stringcheckmarkz.string()v.string()type("string")yup.string()
numbercheckmarkz.number()v.number()type("number")yup.number()
booleancheckmarkz.boolean()v.boolean()type("boolean")yup.boolean()
bigintcheckmarkz.bigint()v.bigint()type("bigint")-
datecheckmarkz.date()v.date()type("Date")yup.date()
symbolcheckmarkz.symbol()v.symbol()type("symbol")-
undefinedcheckmarkz.undefined()v.undefined()type("undefined")-
nullcheckmarkz.null()v.null()type("null")-
voidcheckmarkz.void()v.void()type("void")-
anycheckmarkz.any()v.any()type("unknown")yup.mixed()
unknowncheckmarkz.unknown()v.unknown()type("unknown")yup.mixed()
nevercheckmarkz.never()v.never()type("never")-
literalcheckmarkz.literal()v.literal()type("'value'")-
objectcheckmarkz.object()v.object()type({})yup.object()
arraycheckmarkz.array()v.array()type("T[]")yup.array()
tuplecheckmarkz.tuple()v.tuple()type(["T", "U"])yup.tuple()
unioncheckmarkz.union()v.union()type("T|U")-
discriminatedUnioncheckmarkz.discriminatedUnion()v.variant()--
intersectioncheckmarkz.intersection()v.intersect()type("T&U")-
recordcheckmarkz.record()v.record()type("Record<K,V>")-
mapcheckmarkz.map()v.map()--
setcheckmarkz.set()v.set()--
enumcheckmarkz.enum()v.enum()type("'a'|'b'")-
nativeEnumcheckmarkz.nativeEnum()v.enum()--
optionalcheckmark.optional()v.optional()type("T?").optional()
nullablecheckmark.nullable()v.nullable()type("T|null").nullable()
nullishcheckmark.nullish()v.nullish()--
defaultcheckmark.default()v.optional(_, default)-.default()
catchcheckmark.catch()v.fallback()--
transformcheckmark.transform()v.transform().pipe().transform()
refinecheckmark.refine()v.check().narrow().test()
superRefinecheckmark.superRefine()v.rawCheck()--
pipecheckmark.pipe()v.pipe().pipe()-
coercecheckmarkz.coerce.*v.pipe(v.unknown(), v.transform())--
parsecheckmark.parse()v.parse()type().validateSync()
safeParsecheckmark.safeParse()v.safeParse()--
parseAsynccheckmark.parseAsync()v.parseAsync()-.validate()
safeParseAsynccheckmark.safeParseAsync()v.safeParseAsync()--
brandcheckmark.brand()v.brand()--
readonlycheckmark.readonly()v.readonly()--
lazycheckmarkz.lazy()v.lazy()-yup.lazy()
promisecheckmarkz.promise()---
functioncheckmarkz.function()v.function()--
instanceofcheckmarkz.instanceof()v.instance()type("instanceof X")-
preprocesscheckmarkz.preprocess()v.pipe()--
customcheckmarkz.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>checkmarkOption<A>Option<A>-Option<T>
Some<A>checkmarkSome<A>Some<A>-Some<T>
NonecheckmarkNoneNone-None
some(a)checkmarkO.some(a)Option.some(a)-Some(a)
nonecheckmarkO.noneOption.none()-None
isSomecheckmarkO.isSomeOption.isSome-.some
isNonecheckmarkO.isNoneOption.isNone-.none
fromNullablecheckmarkO.fromNullableOption.fromNullable--
fromPredicatecheckmarkO.fromPredicateOption.filter--
mapcheckmarkO.mapOption.map-.map()
flatMap / chaincheckmarkO.flatMap / O.chainOption.flatMap-.andThen()
match / foldcheckmarkO.match / O.foldOption.match-.match()
getOrElsecheckmarkO.getOrElseOption.getOrElse-.unwrapOr()
orElse / altcheckmarkO.orElse / O.altOption.orElse-.or()
filtercheckmarkO.filterOption.filter--
toNullablecheckmarkO.toNullableOption.getOrNull--
toUndefinedcheckmarkO.toUndefinedOption.getOrUndefined--
flattencheckmarkO.flattenOption.flatten--
tryCatchcheckmarkO.tryCatchOption.liftThrowable--

Either / Result

Pithos (Zygos)fp-tsEffectneverthrowts-results
Either<E, A>checkmarkEither<E, A>Either<L, R>--
Result<T, E>checkmark-Exit<A, E>Result<T, E>Result<T, E>
Left<E> / ErrcheckmarkLeft<E>Either.leftErr<E>Err<E>
Right<A> / OkcheckmarkRight<A>Either.rightOk<T>Ok<T>
left(e) / err(e)checkmarkE.left(e)Either.left(e)err(e)Err(e)
right(a) / ok(a)checkmarkE.right(a)Either.right(a)ok(a)Ok(a)
isLeft / isErrcheckmarkE.isLeftEither.isLeft.isErr().err
isRight / isOkcheckmarkE.isRightEither.isRight.isOk().ok
mapcheckmarkE.mapEither.map.map().map()
mapLeft / mapErrcheckmarkE.mapLeftEither.mapLeft.mapErr().mapErr()
flatMap / andThencheckmarkE.flatMap / E.chainEither.flatMap.andThen().andThen()
match / foldcheckmarkE.match / E.foldEither.match.match().match()
getOrElsecheckmarkE.getOrElseEither.getOrElse.unwrapOr().unwrapOr()
orElsecheckmarkE.orElseEither.orElse.orElse().or()
fromNullablecheckmarkE.fromNullable---
fromPredicatecheckmarkE.fromPredicate---
tryCatchcheckmarkE.tryCatchEffect.tryResult.fromThrowable-
fromOptioncheckmarkE.fromOption---
toUnioncheckmarkE.toUnionEither.merge--
swapcheckmarkE.swapEither.flip--
filterOrElsecheckmarkE.filterOrElse---
Do notationcheckmarkE.DoEffect.gen--
bindcheckmarkE.bind---
apScheckmarkE.apS---

Task / Async

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

Detailed Comparisons