File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
grin/src/Transformations/ExtendedSyntax/Optimising Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 22module Transformations.ExtendedSyntax.Optimising.TrivialCaseElimination where
33
44import Data.Functor.Foldable as Foldable
5- import Grin.Grin
6- import Transformations.Util
5+ import Grin.ExtendedSyntax. Grin
6+ import Transformations.ExtendedSyntax. Util
77
88trivialCaseElimination :: Exp -> Exp
99trivialCaseElimination = ana builder where
1010 builder :: Exp -> ExpF Exp
1111 builder = \ case
12- ECase val [Alt DefaultPat body] -> SBlockF body
13- ECase val [Alt cpat body] -> SBlockF $ EBind (SReturn val) (cpatToLPat cpat) body
12+ ECase scrut [Alt DefaultPat _altName body] -> SBlockF body
13+ ECase scrut [Alt cpat _altName body] -> SBlockF $ EBind (SReturn ( Var scrut)) (cPatToAsPat scrut cpat) body
1414 exp -> project exp
You can’t perform that action at this time.
0 commit comments