don't say 'thing'

This commit is contained in:
Niko Matsakis 2018-03-09 04:19:36 -05:00
parent 6f99f12c2a
commit fd92491375
1 changed files with 9 additions and 7 deletions

View File

@ -2,13 +2,15 @@
Canonicalization is the process of **isolating** an inference value Canonicalization is the process of **isolating** an inference value
from its context. It is really based on a very simple concept: every from its context. It is really based on a very simple concept: every
[inference variable](./type-inference.html#vars) is always in one of two [inference variable](./type-inference.html#vars) is always in one of
states: either it is **unbound**, in which case we don't know yet what two states: either it is **unbound**, in which case we don't know yet
type it is, or it is **bound**, in which case we do. So to isolate what type it is, or it is **bound**, in which case we do. So to
some thing T from its environment, we just walk down and find the isolate some data-structure T that contains types/regions from its
unbound variables that appear in T; those variables get renumbered in environment, we just walk down and find the unbound variables that
a canonical order (left to right, for the most part, but really it appear in T; those variables get replaced with "canonical variables",
doesn't matter as long as it is consistent). starting from zero and numbered in a fixed order (left to right, for
the most part, but really it doesn't matter as long as it is
consistent).
So, for example, if we have the type `X = (?T, ?U)`, where `?T` and So, for example, if we have the type `X = (?T, ?U)`, where `?T` and
`?U` are distinct, unbound inference variables, then the canonical `?U` are distinct, unbound inference variables, then the canonical