Releases: reazen/relude-parse
Releases · reazen/relude-parse
v0.8.0
🚨 Breaking changes
- The
bs-abstractpeer-dependency is nowbs-bastet, and the required Relude version is 0.59+. See the Relude release notes and the Bastet migration guide for details.
v0.7.0
🚨 Breaking
- Changed
<&>(tuple2operator) to<^>to workaround duplicate export issue in bucklescript rescript-lang/rescript#3807
v0.6.0
✨ New
Parser
unit- Parser that produces a()value regardless of inputthrowError- Parser that fails with the givenParseError.tregardless of input (for theMONAD_THROWtypeclass instance)MonadThrowtypeclass instance forParser.t('a)catchError- Parser that handles a failed parse by converting the givenParseError.tinto a newParser.t(for theMONAD_ERRORtypeclass instance)MonadErrortypeclass isntance forParser.t('a)manyUntilWithEnd- similar tomanyUntil, but produces the[]of results and the consumed terminator in a tuplemany1UntilWithEnd- similar tomanyUntil, but produces theNelof results and the consumed terminator in a tuplemanyUntilPeekWithEnd- 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 aNelof 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 terminatormany1UntilPeek- parses 1 or more values using a parser, until a terminator is reached, producing a[]of results, and discarding the non-consumed terminatoraltLazy- similar toalt, but the right-side fallback argument is lazyorElse- similar toalt, but the arguments are reversed, and thefallbackargument is labelled, for more natural and less-error-prone use with|>orElseLazy- similar toorElse, but thefallbackparser is lazypeek- new alias forlookAheadlookAheadNot- similar tolookAhead, but fails if the parser succeedspeekNot- alias forlookAheadNotgetSome- converts a parser ofoption('a)to a parser of'a, failing if the value isNonegetNonEmptyStr- validates that a parser ofstringcontains a non-emptystringgetFst- converts a parser of('a, 'b)to a parser of'aby discarding the'bgetSnd- converts a parser of('a, 'b)to a parser of'bby discarding the'aorEOF- attempts a parser and discards the result, or if it fails, attempt theeofparser. Shortcut formyParser |> void <|> eofnotCharparses a single char, but fails if it matches the given charcr- parses a carriage return\rlf- parses a line feed\ncrlf- parses a\r\neol- parses common line endingscrlf <|> cr <|> lforEOL- similar toorEOF, but for line endings
NanpPhone
- Added a show function with various "common" formats for NANP phone numbers
v0.5.0
✨ 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
unsafeMakefunction, 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
Documentation release
v0.3.0
🚨 Breaking changes
- Renamed
optionaltoopt, and maybe a few other things
✨ New stuff
- Added parsers for common decimal formats, boolean values, etc.
- Improved test coverage
v0.2.0
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