diff options
Diffstat (limited to 'u/fn')
-rw-r--r-- | u/fn/either.ts | 6 | ||||
-rw-r--r-- | u/fn/mod.ts | 1 |
2 files changed, 4 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>( diff --git a/u/fn/mod.ts b/u/fn/mod.ts index f0fbe88..265c6db 100644 --- a/u/fn/mod.ts +++ b/u/fn/mod.ts @@ -1,2 +1,3 @@ export * from "./callable.ts"; export * from "./either.ts"; +export * from "./memoize.ts"; |