Skip to content

Releases: reazen/relude-parse

v0.8.0

31 Mar 18:19
Compare
Choose a tag to compare

🚨 Breaking changes

v0.7.0

05 Sep 20:18
Compare
Choose a tag to compare

🚨 Breaking

v0.6.0

04 Sep 16:43
Compare
Choose a tag to compare

✨ New

Parser

  • unit - Parser that produces a () value regardless of input
  • throwError - Parser that fails with the given ParseError.t regardless of input (for the MONAD_THROW typeclass instance)
  • MonadThrow typeclass instance for Parser.t('a)
  • catchError - Parser that handles a failed parse by converting the given ParseError.t into a new Parser.t (for the MONAD_ERROR typeclass instance)
  • MonadError typeclass isntance for Parser.t('a)
  • manyUntilWithEnd - similar to manyUntil, but produces the [] of results and the consumed terminator in a tuple
  • many1UntilWithEnd - similar to manyUntil, but produces the Nel of results and the consumed terminator in a tuple
  • manyUntilPeekWithEnd - parses 0 or more values using a parser, until a terminator is reached, producing a [] of results and the parsed terminator, without consuming the terminator (peeks the terminator)
  • many1UntilPeekWithEnd - parses 1 or more values using a parser, until a terminator is reached, producing a Nel of results and the parsed terminator, without consuming the terminator (peeks the terminator)
  • manyUntilPeek - parses 0 or more values using a parser, until a terminator is reached, producing a [] of results, and discarding the non-consumed terminator
  • many1UntilPeek - parses 1 or more values using a parser, until a terminator is reached, producing a [] of results, and discarding the non-consumed terminator
  • altLazy - similar to alt, but the right-side fallback argument is lazy
  • orElse - similar to alt, but the arguments are reversed, and the fallback argument is labelled, for more natural and less-error-prone use with |>
  • orElseLazy - similar to orElse, but the fallback parser is lazy
  • peek - new alias for lookAhead
  • lookAheadNot - similar to lookAhead, but fails if the parser succeeds
  • peekNot - alias for lookAheadNot
  • getSome - converts a parser of option('a) to a parser of 'a, failing if the value is None
  • getNonEmptyStr - validates that a parser of string contains a non-empty string
  • getFst - converts a parser of ('a, 'b) to a parser of 'a by discarding the 'b
  • getSnd - converts a parser of ('a, 'b) to a parser of 'b by discarding the 'a
  • orEOF - attempts a parser and discards the result, or if it fails, attempt the eof parser. Shortcut for myParser |> void <|> eof
  • notChar parses a single char, but fails if it matches the given char
  • cr - parses a carriage return \r
  • lf - parses a line feed \n
  • crlf - parses a \r\n
  • eol - parses common line endings crlf <|> cr <|> lf
  • orEOL - similar to orEOF, but for line endings

NanpPhone

  • Added a show function with various "common" formats for NANP phone numbers

v0.5.0

22 Aug 14:23
Compare
Choose a tag to compare

✨ New

  • Added NANP (North American Numbering Plan) phone number parser to extras

🚨 Breaking changes

  • Added .rei interface files for the extra parser modules, to close some type/data safety holes
    • Data constructors are now hidden
    • The only way to construct values of these types is to use a parse function, or construct a value using an unsafeMake function, which will throw an exception for bad data (but serves as an escape hatch when you know you have valid data ahead of time).

v0.4.0

02 Aug 01:54
Compare
Choose a tag to compare

Documentation release

v0.3.0

01 Aug 05:04
Compare
Choose a tag to compare

🚨 Breaking changes

  • Renamed optional to opt, and maybe a few other things

✨ New stuff

  • Added parsers for common decimal formats, boolean values, etc.
  • Improved test coverage

v0.2.0

31 Jul 06:28
Compare
Choose a tag to compare

Initial release

  • Core API is basically done, but might be subject to some name changes once I re-review all function names
  • Documentation exists in the code and tests, but a README is still needed
  • URL parser and other small utility parsers are in the works for a future release