• Just like Simple.int where you have to handle negation yourself. The only difference is that you provide two potential problems:

    const int =
    <PROBLEM>(expecting: PROBLEM) =>
    (invalid: PROBLEM): Parser<PROBLEM, number> => {
    return number({
    int: Ok((id: number) => id),
    hex: Err(invalid),
    octal: Err(invalid),
    binary: Err(invalid),
    float: Err(invalid),
    invalid: invalid,
    expecting: expecting,
    });
    };

    You can use problems like ExpectingInt and InvalidNumber.

    Type Parameters

    • PROBLEM

    Parameters

    • expecting: PROBLEM

    Returns ((invalid: PROBLEM) => Parser.Parser<number, never, PROBLEM>)

      • (invalid: PROBLEM): Parser.Parser<number, never, PROBLEM>
      • Parameters

        • invalid: PROBLEM

        Returns Parser.Parser<number, never, PROBLEM>