I’m trying to define type like:
type aaa = NULL | {a: int; b: int};;
But the compiler does not allow to do it. I’m not sure of the reason why we can’t mix record type with anything else.
I need to match a value if it is the record type or null record and I’m tired of creating dummy record like {a = -999; b = -999}.
is there a better way ?
The “record” part of the definition has to be done in a separate type. Then you can wrap that in an “option” type if you want to express “None” or “Some value”.