-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for tracking unknown fields. (#129)
- Every message has a new field containing a list of unknown fields: ```unknownFields :: Message msg => Lens' msg [TaggedValue]``` - Unknown fields are preserved by `decodeMessage`, `encodeMessage`, and `showMessage` - Unknown fields still cause an error for `readMessage`. A few TODOs: - For now, unknown groups are printed sub-optimally by `showMessage`: the start/end group tags (and everything in between) all get displayed as individual fields, rather than being organized into a sub-struct. - The `discardUnknownFields` function isn't recursive, unlike in other languages. - The Ord instance doesn't try to do anything special, just treating the unknown fields as a list of values. If it really matters then `discardUnknownFields` can help resolve the ambiguity.
- Loading branch information
Showing
16 changed files
with
447 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.