dart-lang / dart-lang/language
Sugar for simulated higher-kinded types through type defunctionalization.
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
Languages without higher-kinded types (HKT) have libraries for functional programming that make use of simulated HKT through [[2014] Type defunctionalization (1.3)](https://www.cl.cam.ac.uk/~jdy22/papers/lightweight-higher-kinded-polymorphism.pdf).
Examples:
TypeScript: [fp-ts](https://github.com/gcanti/fp-ts)
Swift: [bow](https://github.com/bow-swift/bow)
Java: [HKT](https://github.com/derive4j/hkt) & [highj](https://github.com/highj/highj)
Kotlin: [arrow](https://arrow-kt.io/docs/patterns/glossary/)
They require quite a bit of boilerplate which does make them impractical in day to day use.
This is not a topic that I expect to receive much interest and support anytime soon. Also, I'm not an expert on that topic, but I've come across the limitations of dart when trying to employ techniques that are more common in the FP world. And with this issue I'd like to ask the language team if they could provide their thoughts on adding support (or rather sugar) for simulated HKT through type defunctionalization.
_Note:
The dart specification explicitly says [Dart does not, and will not, support higher-kinded types](https://dart.dev/guides/language/specifications/DartLangSpec-v2.2.pdf) I assume that this decision has been made in the context of _'real'_ higher-kinded types. I want to be clear, I'm opening this issue in the context of supporting **simulated** higher-kinded types through type defunctionalization (or any other technique)._
Contributor guide
Research direction
Start by reading the linked type-defunctionalization paper and the Dart language specification section stating that higher-kinded types are unsupported. Compare the cited TypeScript, Swift, Java, and Kotlin approaches with Dart's constraints. Done would require a concrete, feasible language-design proposal and agreement on whether simulated higher-kinded types should be supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100