dex-lang
dex-lang copied to clipboard
Generalize top-level function types
For example, one might type
my_name = some_irritatingly_named_prelude_function
or
my_name = flip something_with_bad_argument_order
etc.
Status quo is that, if either of the right-hand sides is polymorphic, Dex will refuse to type this, because of ambiguous type variables. For this case, it would be good to automatically generalize the types. However, we don't want to generalize data (for the same reason as the Dreaded Monomorphism Restriction), or, probably local bindings; but top-level function types seem to be a clear win.