Created
April 15, 2011 06:24
-
-
Save kxbmap/921241 to your computer and use it in GitHub Desktop.
Scala2.8.1でList[java.util.Date].min
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
scala> trait DateOrdering extends scala.math.Ordering[java.util.Date] { | |
| def compare(x: java.util.Date, y: java.util.Date) = x.compareTo(y) | |
| } | |
defined trait DateOrdering | |
scala> implicit object Date extends DateOrdering | |
defined module Date | |
scala> List(new java.util.Date()).min | |
res6: java.util.Date = Fri Apr 15 15:16:18 JST 2011 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment