Split the ‘Stream’ type class. The methods ‘showTokens’ and ‘tokensLength’
have been put into a separate type class ‘VisualStream’, while ‘reachOffset’
and ‘reachOffsetNoLine’ are now in ‘TraversableStream’. This should make
defining ‘Stream’ instances for custom streams easier.
Defined ‘Stream’ instances for lists and ‘Seq’s.
After bumping the version to 8.0.0 some packages stopped building even
though we used ‘doJailbreak’. This moves the pin and drops many patches that
became unnecessary.
Megaparsec now supports registration of “delayed” parse errors. On lower
level we added a new field called ‘stateParseErrors’ to the ‘State’ record.
The type also had to change from ‘State s’ to ‘State s e’. This field
contains the list of registered ‘ParseErrors’ that do not end parsing
immediately but still will cause failure in the end if the list is not
empty. Users are expected to register parse errors using the three
functions: ‘registerParseError’, ‘registerFailure’, and
‘registerFancyFailure’. These functions are analogous to those without the
‘register’ prefix, except that they have “delayed” effect.
The methods ‘failure’ and ‘fancyFailure’ of ‘MonadParsec’ are now ordinary
functions and live in ‘Text.Megaparsec’. They are defined in terms of the
new ‘parseError’ method of ‘MonadParsec’. This method allows us to signal
parse errors at a given offset without manipulating parser state manually.