Last active
August 29, 2015 14:19
-
-
Save ngbinh/5ad70eab8b67167e350c to your computer and use it in GitHub Desktop.
Model ADT
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
sealed trait Id[T <: Id[T]] | |
trait Mid[T <: Mid[T]] extends Id[Mid[T]] | |
trait Sid[T <: Mid[T]] extends Id[Sid[T]] | |
case class AMid() extends Mid[AMid] | |
case class CSid() extends Sid[AMid] | |
// I wish to get rid of the _ | |
case class E[T <: Sid[_]](s: T) extends Id[E[T]] | |
val amid = AMid() | |
val csid = CSid() | |
val e = E(csid) | |
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
def unapply(): Option[E[_]] = { | |
Some(e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment