22
votes

There exists a notion that combining reified generics with higher-kinded types is a hard problem.

Are there existing languages who have successfully combined these two type system features or is it not possible in general?

Is there any further information available to understand what has been done in this space until now?

1
Does c++ template count?J-16 SDiZ
C++ doesn't really have that much of a runtime reflection system ... the question was more targeted to modern languages, but I have nothing against an answer from a C++ perpsective.soc
modern language != dynamic, and c++ do have RTTI (not reflection). My answer to this question is: just see how messy c++ template is :)J-16 SDiZ
Just curious. What's the problem in combining them? An explanation or a link to one would be welcome.n. 1.8e9-where's-my-share m.
@n.m: I tried to come up with a good link, but I couldn't find anything substantial, that's why I described it as "a notion" here ...soc

1 Answers

4
votes

For the second part of the question: Have a look at the Scala programming language which has successfully combined reified generics from the underlying JVM with higher kinded types. The key concepts to make this work are implicit parameters and Manifests. A manifests is used to port some of the erased type information over to run time and implicits are used to inject the manifest in a type class like manner. The blog post Manifests: Reified Types has more details.