Created
November 16, 2015 11:14
-
-
Save dragos/7873a12a99a0f0ab1160 to your computer and use it in GitHub Desktop.
Overloading Dataset.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Encoder[T] | |
trait JFunction[T, U] | |
trait Dataset[T] { | |
def map[U](f: T => U)(implicit encoder: Encoder[U]) | |
def map[U](f: JFunction[T, U], encoder: Encoder[U]) | |
} | |
trait Testing { | |
implicit val e: Encoder[Int] = ??? | |
val f: Dataset[String] = ??? | |
f.map(x => x.length()) | |
f.map(null, e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment