mlscript icon indicating copy to clipboard operation
mlscript copied to clipboard

Sound and improved treatment of polymorphism and type variables

Open LPTK opened this issue 3 years ago • 0 comments

We should not generalize non-function values, which is unsound in the presence of mutation.

Also, it would be good to handle all 'a variables as rigid and have a different ?a syntax for flexible ones.

Also, we should be able to refer to the same variables across type annotations in a given def. So we should store type variables in the typing context, not just in an inner map of typeType2.

LPTK avatar Jul 13 '22 04:07 LPTK