Created
January 29, 2013 18:16
-
-
Save boggle/4666313 to your computer and use it in GitHub Desktop.
Solving AST typing riddles
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
trait Rewriter[T] extends { | |
def rewrite[X <: T](a: Rewritable[X]): Rewritable[X] | |
} | |
trait Rewritable[T] { | |
self: T with Rewritable[T] => | |
def rewrite(r: Rewriter[T]): T = r.rewrite[T](self).reveal | |
def reveal: T = self | |
} | |
class A extends Rewritable[A] | |
class B extends A with Rewritable[B] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment