Created
April 11, 2014 03:29
-
-
Save danellis/10439459 to your computer and use it in GitHub Desktop.
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
import scala.language.{implicitConversions, existentials} | |
class Encoder[T] | |
implicit object StringEncoder extends Encoder[String] | |
case class Encodable(encoder: Encoder[_], obj: Any) | |
implicit def obj2encodable[T: Encoder](obj: T): Encodable = Encodable(implicitly[Encoder[T]], obj) | |
trait Resource { | |
def request(): Encodable | |
} | |
object Res1 extends Resource { | |
def request() = "hello" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment