Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Choice operator. Try left; if it fails, try right.
This is a problematic combinator:
- Implementation is clumsy due to internal parser state being untouchable. We must record seen characters, in order to replay them on the right parser in case the left parser fails.
- Errors degrade due to left parser errors being discarded. Perhaps your string was one character off a successful left parse; but if it fails, you won't see that error.
- It's hard to reason aobut. It might break in certain situations.