hmac / kite

A Haskell-like language for scripting and web apps
BSD 3-Clause "New" or "Revised" License
12 stars 0 forks source link

Substitution in typechecking #5

Closed hmac closed 1 year ago

hmac commented 3 years ago

Note that when apply a context as a substitution, the substitution should be applied either

Specifically, this means that applying the context [e0 = A, e1 = e0 -> A] is equivalent to applying either:

The effect of this is that any assignments between existential variables are resolved as much as possible. This is important because when typechecking a function type we generate assignments between existentials such as e0 = e1 -> e2, e1 = A, e2 = B.

We should double check we're doing this correctly.