Releases: reazen/relude-parse
Releases · reazen/relude-parse
v0.8.0
🚨 Breaking changes
- The
bs-abstract
peer-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
<&>
(tuple2
operator) 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.t
regardless of input (for theMONAD_THROW
typeclass instance)MonadThrow
typeclass instance forParser.t('a)
catchError
- Parser that handles a failed parse by converting the givenParseError.t
into a newParser.t
(for theMONAD_ERROR
typeclass instance)MonadError
typeclass isntance forParser.t('a)
manyUntilWithEnd
- similar tomanyUntil
, but produces the[]
of results and the consumed terminator in a tuplemany1UntilWithEnd
- similar tomanyUntil
, but produces theNel
of 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 aNel
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 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 thefallback
argument is labelled, for more natural and less-error-prone use with|>
orElseLazy
- similar toorElse
, but thefallback
parser is lazypeek
- new alias forlookAhead
lookAheadNot
- similar tolookAhead
, but fails if the parser succeedspeekNot
- alias forlookAheadNot
getSome
- converts a parser ofoption('a)
to a parser of'a
, failing if the value isNone
getNonEmptyStr
- validates that a parser ofstring
contains a non-emptystring
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 theeof
parser. Shortcut formyParser |> void <|> eof
notChar
parses a single char, but fails if it matches the given charcr
- parses a carriage return\r
lf
- parses a line feed\n
crlf
- parses a\r\n
eol
- parses common line endingscrlf <|> cr <|> lf
orEOL
- 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
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
Documentation release
v0.3.0
🚨 Breaking changes
- Renamed
optional
toopt
, 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