diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Split TpVar name args into TpData name args and TpVar name #81

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

Closes #84. It doesn't change any behavior, but I was finding it confusing that the type variables used in unification and in quantifiers were the same as the type application of a datatype name to its arguments.

In particular, there were places that the code was trying to test for one or the other either by (a) checking whether the argument list is empty or (b) checking whether the name belongs to a map of datatype names or (c) testing whether the name starts with # or ?. It all worked out okay, but I think it's much clearer now to have the distinction made in the type itself.

I think there might also have been a place in the code where a unification type variable was receiving tags as arguments?