-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently Ast.Pat (irrefutable patterns) and Ast.RefutPat are totally separate. It would be nice to relate them so that an Ast.Pat can be used wherever an Ast.RefutPat is expected.
Could this be done using recursion schemes?
Ex:
data Pat r
= VarPat String
| TuplePat [r]
data RefutPat r
= VarRefutPat String
| VrntRefutPat String [r]
| IrrefutPat (Pat r)Then let and match expressions would become:
data Expr
...
| LetF (Pat (Fix Pat)) r
...
| MatchF r [(RefutPat (Fix RefutPat), Seq r)]
...Hopefully this would simplify pattern matching/destructuring compilation in TastToHir.hs.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request