I'd like to receive a type error if a case function is missing cases.
union-type already does this but it will only throw if the current case is missing - which makes it quite likely that you miss a substantial set of bugs ( and the main benefit of union types ).
The above doesn't fail, even though the case is not handling all domains. It should check if the case function has the same keys as the Type definition.
I'd like to receive a type error if a case function is missing cases. union-type already does this but it will only throw if the current case is missing - which makes it quite likely that you miss a substantial set of bugs ( and the main benefit of union types ).
An example:
The above doesn't fail, even though the case is not handling all domains. It should check if the case function has the same keys as the Type definition.