You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which always does the right thing when creating variable expressions. Depending on what the Var is, it will create: a value using the Var constructor, a type variable using (Type . TyVarTy), or a Coercion variable.
It is ok to pattern match on the Var constructor, but whenever you are building a CoreExpr,
you should use varToCoreExpr.
Doing so has the nice knock-on effect that GHC's other higher-level functions Just Work. For instance, we can count on extendSubst to properly build substitution environments, rather than manually case-ing on expressions and using lower-level functions.