Function run

  • Try a parser. Here are some examples using the keyword parser:

      run(keyword("true"))("true")  // => Ok ()
    run(keyword("true"))("True") // => Err ...
    run(keyword("true"))("false") // => Err ...
    run(keyword("true"))("true!") // => Ok ()

    Notice the last case! A Parser will chomp as much as possible and not worry about the rest. Use the end parser to ensure you made it to the end of the string!

    Type Parameters

    • A

    Parameters

    Returns ((src: string) => Result<A, Simple.DeadEnd[]>)