Created
May 24, 2011 08:35
-
-
Save xuwei-k/988340 to your computer and use it in GitHub Desktop.
DRYとか型安全を求めすぎて厨二病的なことになってる感じ
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
sealed trait ReturnType{ | |
type A | |
val func:(String => A) | |
} | |
object ReturnType{ | |
object IntType extends ReturnType{ type A = Int ; val func = (_:String).toInt } | |
object LongType extends ReturnType{ type A = Long ; val func = (_:String).toLong } | |
object StringType extends ReturnType{ type A = String ; val func = identity[String] _ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment