spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Voitot Dev <pascal.voitot....@gmail.com>
Subject Re: Making RDDs Covariant
Date Sat, 22 Mar 2014 19:42:26 GMT
On Sat, Mar 22, 2014 at 8:38 PM, David Hall <dlwh@cs.berkeley.edu> wrote:

> On Sat, Mar 22, 2014 at 8:59 AM, Pascal Voitot Dev <
> pascal.voitot.dev@gmail.com> wrote:
>
> > The problem I was talking about is when you try to use typeclass
> converters
> > and make them contravariant/covariant for input/output. Something like:
> >
> > Reader[-I, +O] { def read(i:I): O }
> >
> > Doing this, you soon have implicit collisions and philosophical concerns
> > about what it means to serialize/deserialize a Parent class and a Child
> > class...
> >
>
>
> You should (almost) never make a typeclass param contravariant. It's almost
> certainly not what you want:
>
> https://issues.scala-lang.org/browse/SI-2509
>
> -- David
>

I confirm that it's a pain and I must say I never do it but I've inherited
historical code that did it :)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message