Skip to content

Instantly share code, notes, and snippets.

@danellis
Created April 11, 2014 03:29
Show Gist options
  • Save danellis/10439459 to your computer and use it in GitHub Desktop.
Save danellis/10439459 to your computer and use it in GitHub Desktop.
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