-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
add RFC for HKTs #134
add RFC for HKTs #134
Conversation
|
||
tl;dr: scary for users and maintainers | ||
|
||
If this is accepted, it could (and perhaps should) be used throughout the implementation of Pony to write more generic code. This is risky. It also can make the code (on first blush) a bit more opaque to those not familiar with HKTs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could there be another set of standard-lib-like modules instead? I'm thinking of scala's cats stuff; not necessarily as the one true way to go, but as a means to reduce this risk, and letting users opt into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and no, I think. If the standard lib supported HKTs, I could definitely see libraries to support more functional style things (like Cats as you mentioned). I actually opened this because I was hoping to create such a lib. The ultimate blocker is that there's no such language feature for HKTs.
We'll have to consider how this would be implemented. There has been some somewhat related discussion around this RFC: #123 |
I wasn’t aware of this thread then I posted to the mailing list asking if there’s interest in HKTs. Note my pertinent comment at the mailing list about type-level lambdas. |
Some reading material that @sylvanc shared for us on this topic from the work on the Dotty language: And here's the user documentation for HKTs in Dotty: |
I'd love to help, but I'm very new to Pony. If someone would be willing to help me up front, I would be happy to try to make some contributions to this. |
I have a standing offer to do some calls to synchronously knowledge share and answer questions for anyone who is interested in becoming a serious contributor to the compiler. I don't know everything about the whole codebase, but I'm happy to share what I know and get you pointed in the right direction if you have some time to commit to this (or any other compiler bug/feature ticket you want to pick up) |
I'm playing with the compiler on this branch and hopefully that's where HKTs will land... for now, I'm not planning anything fancy with implicits; those are mostly a nice-to-have and not a blocker. It seems like the first step is to change the parser rules to allow optional |
During discussion on slack with @erip and @jemc the question about interaction of HKTs with Given the following example for more context:
The Should it be possible, e.g. in the body of
That is,
What would the resulting logic for delaying the reification be? It should have all information at the call-side of |
I prefer just passing the unparameterizered type arg into the (e.g.)
In the above formulation, just the type (the nullary constructable) which would be constructed needs to be passed ( Again, this is nuts and bolts -- I'm happy to move forward in whichever direction is most tractable. Another reason for prefering just the type parameter: when expressing a constraint, the following would be quite cumbersome and ugly: trait Something[F[_]: Functor[_]]
// ... |
I am fine either way for the syntax of how to pass typeargs for HKT params for now. The internals of implementing it in the compiler would differ, but that is of lesser importance to me. I'd suggest describing the intended approach for syntax and implementation in greater detail in this RFC document to get some initial feedback before investing too much work on the implementation. The concept should be solid. |
@mfelsche that semes like a reasonable idea. I'll add a note here so I can remember to add it to the formal proposal: Need to include:
Probably more |
Rendered