Commit ab2fe555 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Comments in CoreSyn only

parent b2e8bed8
......@@ -146,6 +146,7 @@ These data types are the heart of the compiler
-- f_1 x_2 = let f_3 x_4 = x_4 + 1
-- in f_3 (x_2 - 2)
-- @
-- But see Note [Shadowing] below.
-- 3. The resulting syntax tree undergoes type checking (which also deals with instantiating
-- type class arguments) to yield a 'HsExpr.HsExpr' type that has 'Id.Id' as it's names.
......@@ -312,6 +313,13 @@ In particular, scrutinee variables `x` in expressions of the form
"wild_". These "wild" variables may appear in the body of the
case-expression, and further, may be shadowed within the body.
So the Unique in an Var is not really unique at all. Still, it's very
useful to give a constant-time equality/ordering for Vars, and to give
a key that can be used to make sets of Vars (VarSet), or mappings from
Vars to other things (VarEnv). Moreover, if you do want to eliminate
shadowing, you can give a new Unique to an Id without changing its
printable name, which makes debugging easier.
Note [Literal alternatives]
Literal alternatives (LitAlt lit) are always for *un-lifted* literals.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment