-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24841e1
commit 10db62e
Showing
2 changed files
with
1 addition
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9: Pattern Match Exhaustivity: (C4(), _), (_, C4()) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
sealed trait Root[T] | ||
case object C1 extends Root[Int] | ||
case object C2 extends Root[String] | ||
//case class C3[X, Y]() extends Root[X|Y|(X => X)] | ||
case class C3[X, Y]() extends Root[(X => X)|(Y => Y)|(X => Y)] | ||
case class C4[X, Y]() extends Root[(X => X)|(Y => Y)|(X => Y)] | ||
|
||
object TestGADT { | ||
//type Foo // abstract | ||
|
||
def f[A <: Seq[_], B, Foo >: A => B](v: Root[Foo], u: Root[Foo]) = (v, u) match { | ||
//case C1 => | ||
//case C2 => | ||
case (C3(), C3()) => | ||
} | ||
//f(C3[Int, Int]()) | ||
//implicitly[Int <:< Int|(Int => Int)] | ||
//implicitly[(Int => Int) <:< String|(Int => Int)]//($conforms[Int => Int]) | ||
//f[Int, Int, Int|(Int => Int)](C3[Int, Int]()) | ||
//f(C3[Int, Int]()) | ||
f(C3[Seq[_], Long](), C4[Seq[_], Long]()) | ||
} |