File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
grin/src/Transformations/ExtendedSyntax Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,14 @@ instance Convertible Exp New.Exp where
150150 | EBind (SReturn (Var var')) (ConstTagNode tag args) rhs2 <- rhs1
151151 , var == var'
152152 -> pure $ New. EBindF lhs1 (oldNodeToAsPat tag args var) rhs2
153- {- NOTE:
153+ {- NOTE: The following transformation can be done, because
154+ unit and literal patterns are redundant. If the variable has
155+ the same value as the pattern, then we can safely remove the
156+ binding. If the variable holds some value different from the pattern,
157+ then the program's behaviour is undefined, so we can do anything
158+ with it.
159+
160+
154161 v.0 <- pure <value>
155162 <pat> <- pure v.0 -- pat is neither a node pat nor a var pat
156163 <rhs2>
You can’t perform that action at this time.
0 commit comments