But you can do: 1. A wrapper for RDD that will accumulate mapping functions and can get back RDD only when you supply a ClassTag 2. Define your own "restricted" or "constrained" version of a functor typeclass. Something like trait CFunctor[F[_], C[_]]{ def cmap[A, B](fa: F[A])(f : A => B)( implicit ca: C[A], cb: C[B]): F[B] }
With further definitions type Dummy[A] = A <:< Any CFunctor[F, Dummy] will be equivalent to the ordinary Functor[F] and CFunctor[F, ClassTag] could be implemented for the RDD type constructor
Обсуждают сегодня