Implement quick pattern-check desugaring #50
Labels
🔧 compiler
Issue concerns the compiler
✨ enhancement
New feature or request
❓ invalid
This doesn't seem right
The Catala surface syntax contains a handy sugar that allows to check whether a value of a sum type falls into one of the sum type cases:
catala/src/catala/catala_surface/ast.ml
Line 132 in 933fd02
This AST pattern is not handled by desugaring yet:
catala/src/catala/catala_surface/desugaring.ml
Line 488 in 933fd02
The desugaring should be implemented in the following way. Suppose you have:
Then
x with pattern Case2
should be desugared to:One can take inspiration from
catala/src/catala/catala_surface/desugaring.ml
Lines 259 to 343 in 933fd02
The text was updated successfully, but these errors were encountered: