Open mkjpryor opened 10 years ago
While we do want to expand our generics syntax at some point, I don't think anything involving higher kinds is on our roadmap :) cc @paroski and @pikatchu if they have any comments.
(Though of course if you are interested in implementing something yourself, let us know and we can chat about the language design and implementation considerations.)
I did think it was probably a bit out there - just thought I'd ask.
I would be interested in trying to implement something - I've never worked on anything like a static verifier or virtual machine before, so wouldn't really know where to start, but I am definitely interested in learning... On 2 Jun 2014 20:30, "Josh Watzman" notifications@github.com wrote:
(Though of course if you are interested in implementing something yourself, let us know and we can chat about the language design and implementation considerations.)
— Reply to this email directly or view it on GitHub https://github.com/facebook/hhvm/issues/2825#issuecomment-44880272.
cc @dlreeves @andrewjkennedy
This is a pretty old feature request but it sounds like the kind of thing you guys might be interested in.
Necro :+1:!
Another vote for this. :)
Bit of a blue-sky feature request, but I was just wondering if Hack might ever support higher-kinded types? Since we already have a good lambda syntax and type inference, higher-kinded types would put Hack almost on a par with Scala for hybrid functional/object-oriented programming, but with a more familiar syntax for PHP/Java/C# programmers.
The only syntax change I envisage it requiring is a wildcard for generic types. Since types are erased at runtime, it wouldn't require any runtime changes (other than to strip the new syntax), however the type-checker would be (much) harder...! It would allow us to do some pretty fancy stuff with container types, even down to defining a type-safe monad. I envisage it looking something like this: