Interface Result<T, E>

interface Result<T, E> {
    bind: <U>(fn: (val: T) => Result<U, E>) => Result<U, E>;
    expect: (message: string) => T;
    fmap: <U>(fn: (val: T) => U) => Result<U, E>;
    isErr: () => boolean;
    isOk: () => boolean;
    unwrap: () => T;
    unwrapErr: () => E;
    unwrapOr: <D>(defaultValue: D) => T | D;
    fmapErr<F>(fn: (err: E) => F): Result<T, F>;
}

Type Parameters

  • T
  • E

Properties

bind: <U>(fn: (val: T) => Result<U, E>) => Result<U, E>
expect: (message: string) => T
fmap: <U>(fn: (val: T) => U) => Result<U, E>
isErr: () => boolean
isOk: () => boolean
unwrap: () => T
unwrapErr: () => E
unwrapOr: <D>(defaultValue: D) => T | D

Methods