Рет қаралды 1,321
Building on our knowledge of unification, we look at how it applies to type systems - using Hindley-Milner types as a practical example.
We look at applying this to some type function applications, and also what happens in the case that a type variable is unified with a type that contains the type variable (where what we'd call the "occurs check" fails). We reflect on how unification effectively merges the types, while collecting any constraints on the two types, and how it might become part of a type inference algorithm.
More on unification: en.wikipedia.o...)