simple-monad
    Preparing search index...

    Examples

    Six runnable examples, from plain narrowing to folding multi-tag failures. Each page embeds the actual source of a file in examples/ — the same code CI runs via yarn examples — so what you read here is what executes.

    1. Parse untrusted input — the simple layer: ok / bad + narrowing.
    2. Form validation — several failure modes, dispatched with matchBad.
    3. Wrap a throwing API — turn a hidden exception into an explicit Bad.
    4. Domain operation — valueless success and the unwrap* toolkit.
    5. Result chainingmap and match on the wrapper.
    6. Fold failuresmatch's per-reason bad map.