Skip to content

Instantly share code, notes, and snippets.

@thobson
Created October 24, 2017 18:35
Show Gist options
  • Save thobson/1333ac606075b247027525d956de5fb7 to your computer and use it in GitHub Desktop.
Save thobson/1333ac606075b247027525d956de5fb7 to your computer and use it in GitHub Desktop.
trait VehicleLike[A] {
def drive(a: A): String
}
object Vehicles {
implicit val vehicleLikeCar = ...
implicit val vehicleLikeBus = ...
}
object Dealership {
def driveAndReturn[A](vehicle: A)(implicit vehicleLike: VehicleLike[A]): A = ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment