-
Notifications
You must be signed in to change notification settings - Fork 20
breaking changes
#stage-3 This lists breaking changes between v1 and v2. There are a lot but it has been a consideration.
Also, the compatibility import is meant to bridge the two.
Has a much more restrictive default configuration and you can’t change the base of the number.
All manyX combinators are integrated into ⚙️many as 🚀boosters, for example ⚙️many#sepBy.
All character-based parsers work very differently and are inherently incompatible. Same with parsers that parse strings of specific lengths. See for more information about this.
The 🧩🗑️read parser is a hold over from the previous system, but it’s deprecated on release. It doesn’t have the name of a previous parser on purpose.
These are gone.
-
thenqis replaced by ⚙️skip or the 🚀booster ⚙️then#skip. -
qthencan be replaced using ⚙️then and boosters like ⚙️then#at, ⚙️then#pick and so on.
This is detailed in ️combinators.
The built-in combinators offered by the library will no longer be functions, as the function API interferes with the special combinator API I want to put on them.
This is a breaking change, since a user might have some code that invokes a combinator on a parser as a function. However, such code will no longer work.
Function combinators will still be accepted by e.g. the 🛠️pipe method. They won’t be the default, but they won’t be deprecated either.
The result type has changed. It’s actually been split into two different things:
- The
, which is a result sent and received by parser cores. There are 4 types of signals, just like the current system.
- However, the names are different. See the table below.
- The
kindof the signal is a numeric enum rather than a string. - Emojis are different.
- The result, which is what’s returned by safeParse.
- There are only two types of results — an okay result or failure result. The two are differentiated by the
isOkayproperty. - The result does contain the final signal. But there are still only two result types. The signal is just extra information.
- There are only two types of results — an okay result or failure result. The two are differentiated by the
I haven’t fully fleshed this part out yet.
| v1: result kind | v1: emoji | v2: signal | v2: emoji |
|---|---|---|---|
"OK" |
— | Signal.OK |
✅ |
"Soft" |
😕 | Signal.Fail |
⛔ |
"Hard" |
😬 | Signal.Panic |
😬 |
"Fatal" |
💀 | Signal.Die |
💀 |
I’m deeply dissatisfied with the current approach to visualizing failures. I’m working on something better, but I haven’t fleshed it out yet.