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

forax at univ-mlv.fr forax at univ-mlv.fr
Sun Jun 12 23:36:00 UTC 2016


----- Mail original -----
> De: "org openjdk" <org.openjdk at io7m.com>
> À: forax at univ-mlv.fr, valhalla-dev at openjdk.java.net
> 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 univ-mlv.fr 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
> 
> 

R


More information about the valhalla-dev mailing list