News for hackers. Stuff that matters.
Re:Parse, Don't Validate (2019) by ParetoOptimal on Tuesday March 07, 2023 @07:19PM (#35063426)
> The library didn't allow you to see the things (e.g. particular headers or options for those headers) that it didn't know to parse.

I typically design code around things like this with a sum type like:

    data Header = KnownHeader1 | KnownHeader2 | UnknownHeader String String
Then I typically don't offer any extra support or extended functionality for the cases where the type is `UnknownHeader`.

There are no comments on this comment yet.