Closed byorgey closed 5 months ago
@justingrubbs , @LeitMoth I'd love for you to take a look at this when you get a chance (no rush). I certainly don't expect you to read and understand all the code changes, though you're welcome to look at it in whatever detail you like. But see if the overall idea makes sense, play with some examples, see if you can break it, that kind of thing.
Closes #169. Previously, we did this:
However, this was a lie since in fact
\x. x - 2
is more general than that; but showing only one possible monomorphic type was still better than showing some generic monstrosity likeforall a. (N <: a, subtractive a) => a -> a
.Now, with this PR, we do this:
See #169 for more context and examples.
Briefly, in this PR, we:
LogicT
but that seems difficult/impossible to incorporate intopolysemy
(https://stackoverflow.com/questions/62627695/running-the-nondet-effect-once-in-polysemy; https://github.com/polysemy-research/polysemy/issues/246).It is still possible to make the solver blow up in case there are many possible container variables to instantiate. e.g. expressions like
\x. \y. \z. \w. (set(x), set(y), set(z), set(w))
take a very long time to typecheck. I have some ideas for how to improve this situation, but for now it's an uncommon corner case.