Skip to content

Instantly share code, notes, and snippets.

@nrinaudo
Created November 3, 2015 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrinaudo/e7f21fcd8f72736ceee6 to your computer and use it in GitHub Desktop.
Save nrinaudo/e7f21fcd8f72736ceee6 to your computer and use it in GitHub Desktop.
Demonstration of my issues with export-hook
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
"org.typelevel" %% "export-hook" % "1.0.2",
compilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)
)
import export._
trait Encoder[T] {
// Type class defns ...
}
object Encoder extends EncoderLowPriority {
// Instances which should be higher priority than derived
// or subclass instances should be defined here ...
}
// Derived, subclass and other instances of Encoder are automatically included here ...
@imports[Encoder]
trait EncoderLowPriority {
// Instances which should be lower priority than imported
// instances should be defined here ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment