summaryrefslogtreecommitdiff
path: root/u/fn/either.ts
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2025-05-18 22:54:15 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2025-05-18 22:55:20 -0700
commitd54e91c6582ed160cf2f2fcf977e48b4439d133b (patch)
tree5669367c4fa49bc0373b0c581ea3027218fd5e32 /u/fn/either.ts
parent9cf3fc0259730b7dcf47b3ab4a04369e39fb4614 (diff)
downloadci-theBigRefactor.tar.gz
ci-theBigRefactor.zip
Diffstat (limited to 'u/fn/either.ts')
-rw-r--r--u/fn/either.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/u/fn/either.ts b/u/fn/either.ts
index 9dc1027..8b233bf 100644
--- a/u/fn/either.ts
+++ b/u/fn/either.ts
@@ -10,7 +10,7 @@ export interface IEither<E, T> {
errBranch: Mapper<E, Ee>,
okBranch: Mapper<T, Tt>,
) => IEither<Ee, Tt>;
- fold: <Tt>(folder: BiMapper<E | null, T | null, Tt>) => Tt;
+ fold: <Tt>(folder: BiMapper<E | undefined, T | undefined, Tt>) => Tt;
moveRight: <Tt>(t: Tt) => IEither<E, Tt>;
mapRight: <Tt>(mapper: Mapper<T, Tt>) => IEither<E, Tt>;
mapLeft: <Ee>(mapper: Mapper<E, Ee>) => IEither<Ee, T>;
@@ -31,8 +31,8 @@ export class Either<E, T> implements IEither<E, T> {
return this.mapRight(() => t);
}
- public fold<R>(folder: BiMapper<E | null, T | null, R>): R {
- return folder(this.err ?? null, this.ok ?? null);
+ public fold<R>(folder: BiMapper<E | undefined, T | undefined, R>): R {
+ return folder(this.err ?? undefined, this.ok ?? undefined);
}
public mapBoth<Ee, Tt>(