forked from mirage/ocaml-cstruct
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
it would be nice if, given an enum of the form
cenum foo {
bar1 = v1;
bar2 = v2
} as enumtype
...rather than foo option the parser return something like foo orError where orError would be defined something like
type 'a orError =
| Ok of 'a
| Err of enumtype
the use case is when parsing data -- it's nice to lift to a proper type as early as possible but retain the ability to output some sensible debug info when there's a parse error.
Reactions are currently unavailable