Created
January 15, 2016 15:10
-
-
Save julienrf/db8045606693c16c3cf1 to your computer and use it in GitHub Desktop.
dependent types + higher-kinded types + implicits
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
object OK { | |
trait `*`[A] | |
trait Bar { | |
type Qux | |
implicit val `*`: `*`[Qux] | |
} | |
def foo(bar: Bar): `*`[bar.Qux] = { | |
import bar._ | |
implicitly[`*`[bar.Qux]] | |
} | |
} | |
object KO { | |
trait `* -> *`[F[_]] | |
trait Bar { | |
type Qux[A] | |
implicit val `* -> *`: `* -> *`[Qux] | |
} | |
def foo(bar: Bar): `* -> *`[bar.Qux] = { | |
import bar._ | |
implicitly[`* -> *`[bar.Qux]] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fails with the following error: