plainfp - v0.1.0
    Preparing search index...

    Function toOption

    • Convert a Result into an Option: ok(v) becomes some(v) and err(_) becomes none — the error is discarded. The inverse of Option.toResult.

      Type Parameters

      • T
      • E

      Parameters

      Returns OptionType<T>

      pipe(
      parseUser(body),
      Result.toOption, // drop the parse error, keep just the user if any
      Option.map(u => u.name),
      )