-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support polymorphism #122
Comments
Notes from our 2020-12-02 priorities meeting:
|
(Mostly a note to myself, as I was rather confused about this point. However, it may be food for thought when we design the syntax of our language) I'm looking at Dunfield and Krishnaswami, where they have a fully implicit calculus (i.e. both type applications and type abstractions are invisible, a la Haskell without TypeApplications). This has some weird drawbacks (roughly scoped type variables style stuff familiar from Haskell), but in particular they have (The term above synthesises I wonder if a good solution for our surface language is to have optional (maybe mandatory?) type abstraction binders in terms, simply to bring variables into scope so we can put them in annotations when required. |
Further note, the 2019 paper https://research.cs.queensu.ca/home/jana/papers/gadts/Dunfield19_GADTs.pdf extends their higher-rank work to GADTs |
Shall we promote this to high priority now? |
Status: I think it will be ok to just implement the algorithm in Dunfield-Krishnaswami, assuming I can make it work ok with holes. In the long run, to nail down the language, it would be worth thinking about the strange things GHC does in https://github.com/ghc-proposals/ghc-proposals/blob/wip/spj-deep-skol/proposals/0000-simplify-subsumption.md, and whether we explicitly care one way or the other about any of them. Also, we should consider whether to enforce, tolerate or forbid explicit type application and abstraction. [I think we are agreed that alpha-style enforcement is very clunky and awkward to use -- that is kind of the point of this bug report! But should we tolerate it, or forbid it? D&K forbid it, and I have not yet thought about if their algorithm can tolerate optional type applications/abstractions without much fuss] |
I tried to make a point related to this during today's wrap-up call, but probably not very well. What I was trying to get at was this: what was clunky and awkward in Alpha might not be clunky or awkward in a structure editor like Vonnegut, especially if we make accommodations in the editor to make it easier. So we should be careful of drawing conclusions from Alpha (or any other text-based language) about what's ergonomic in a structure editor, because the context might be very different. Of course, there are also two caveats to what I've just said, as well: 1. this works both ways (what is obvious/convenient in text editing might not be in a structure editor), and 2. it might still be clunky or awkward in Vonnegut, just in a different way! |
I'm going to split this into four parts:
|
Imported from our "Useful links for Primer" issue:
|
I think we can close this issue, yes? We've had a robust polymorphism implementation for over a year now, and while I think it could benefit from some improved inference, that should arguably be tracked separately. |
I'm going to close this. #81 has some ideas for how we could improve inference in some specific cases, but polymorphism support is "done." |
It's unclear whether we should do this before user-defined types (#88). If we do it before those, we'll need at least something like a built-in
Maybe
orList
type.The text was updated successfully, but these errors were encountered: