simple-monad
    Preparing search index...

    Interface Bad<R, V>

    The failure leaf of a result. Carries a string reason tag plus an optional value payload (defaulting to void), and a success: false discriminant.

    interface Bad<R extends ReasonType = ReasonType, V = void> {
        reason: R;
        success: false;
        value: V;
        isBad(): this is Bad<R, V>;
        isOk(): this is never;
    }

    Type Parameters

    • R extends ReasonType = ReasonType

      The reason tag — a string literal such as "not_found".

    • V = void

      The payload type (void when there is no payload).

    Index

    Properties

    Methods

    Properties

    reason: R

    The tag naming which failure mode this is.

    success: false

    Discriminant marking this leaf as a failure (always false).

    value: V

    The failure payload (undefined when constructed without one).

    Methods