Created
January 19, 2012 02:20
-
-
Save soc/1637270 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Eq[-T] | |
| def equal[T](left : T, right : T)(implicit eqT : Eq[T]) = true | |
| implicit def eqInt = new Eq[Int]{} | |
| trait List[T] | |
| implicit def eqList[T](implicit eqT : Eq[T]) = new Eq[List[T]] {} | |
| class ListListInt extends List[List[Int]] | |
| def ints = new ListListInt | |
| equal[ListListInt](ints, ints) | |
| equal(ints, ints) | |
| equal[List[List[Int]]](ints, ints) | |
| equal[ListListInt](ints, ints) | |
| equal(ints, ints) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment