Created
May 31, 2016 14:37
-
-
Save aereal/4de4cad71de214655fe08886ee1b4c2b 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
trait Bounded[T <: Bounded[T]] { | |
self: T => | |
} | |
trait BoundedFactory[V, B <: Bounded[B]] { | |
def build(b: B): V | |
} | |
case class Box[V](value: V) extends Bounded[Box[V]] | |
class BoxFactory[T] extends BoundedFactory[T, Box[T]] { | |
def build(b: Box[T]) = b.value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment