Variants/case classes/algebraic data types/sums/oh my!

forax at forax at
Sun Jun 12 23:36:00 UTC 2016

----- Mail original -----
> De: "org openjdk" <org.openjdk at>
> À: forax at, valhalla-dev at
> Envoyé: Samedi 11 Juin 2016 21:34:49
> Objet: Re: Variants/case classes/algebraic data types/sums/oh my!
> On 2016-06-11T20:40:06 +0200
> forax at wrote:


> > > 
> > > I'm intrigued by this. Is the per-value specialization something that's
> > > currently implemented? That looks a bit dependently-typed to me...
> > 
> > It's not currently implemented but i see not reason to not try to (see my
> > talk at the next JVM Summit (if the talk is accepted)). By example, i
> > think that we need something like that if we want to re-implement method
> > handle combiners as a kind of specialization.
> I was curious and slightly terrified of the idea that this would allow
> for the declaration of the classic dependently-typed length-indexed
> lists in Java, but I see that it doesn't quite work at that level (or
> at least, I assume it doesn't).

I think you should be able to declare this kind of List, perhaps not in Java the language.
It should be even easier than in Haskell because you can dispatch on the wildcard type, something you could not do in Haskell.

> M


More information about the valhalla-dev mailing list