dex-lang icon indicating copy to clipboard operation
dex-lang copied to clipboard

Generalize top-level function types

Open axch opened this issue 2 years ago • 0 comments

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.

axch avatar Apr 15 '22 15:04 axch