Created
March 3, 2015 05:00
-
-
Save rossabaker/bf76b4d3449636a18c12 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
scala> class Foo[A] | |
defined class Foo | |
scala> trait Monad[F[_]]; trait Catchable[F[_]]; trait Runner[F[_]] | |
warning: there were 3 feature warning(s); re-run with -feature for details | |
defined trait Monad | |
defined trait Catchable | |
defined trait Runner | |
scala> implicit def runner[F[_]](implicit M: Monad[F], C: Catchable[F]) = new Runner[F] {} | |
warning: there were 1 feature warning(s); re-run with -feature for details | |
runner: [F[_]](implicit M: Monad[F], implicit C: Catchable[F])Runner[F] | |
scala> implicitly[Runner[Foo]] | |
<console>:13: error: could not find implicit value for parameter e: Runner[Foo] | |
implicitly[Runner[Foo]] | |
^ | |
scala> implicit val FooCatchable = new Catchable[Foo] {} | |
FooCatchable: Catchable[Foo] = $anon$1@6a41eaa2 | |
scala> implicit val FooMonad = new Monad[Foo] {} | |
FooMonad: Monad[Foo] = $anon$1@335eadca | |
scala> implicitly[Runner[Foo]] | |
res1: Runner[Foo] = $anon$1@7d70d1b1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment