Created
December 18, 2011 13:08
-
-
Save halcat0x15a/1493375 to your computer and use it in GitHub Desktop.
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
import Digit._ | |
_1.toInt assert_=== 1 | |
_9.toChar assert_=== '9' | |
_0.toLong assert_=== 0L |
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
1L |+| _1 assert_=== 2L | |
digits(1) |+| 1L assert_=== _2 |
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
"1a3".show.digits assert_=== List(Some(_1), None, Some(_3)) | |
"12a".show.traverseDigits assert_=== None | |
"123".show.traverseDigits assert_=== Some(List(_1, _2, _3)) | |
digits.longDigits assert_=== 123456789L |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment