summaryrefslogtreecommitdiff
path: root/u/fn/either.ts
diff options
context:
space:
mode:
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>(