Created
April 20, 2012 05:33
-
-
Save alexy/2426320 to your computer and use it in GitHub Desktop.
compose method and function
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
def readUserScores(fileName: String): List[UserScore] = { | |
val serocs = ((Nil: List[UserScore]) /: | |
io.Source.fromFile(fileName).getLines() | |
// .map(_.split("\t")).map(array2Pair(_)) | |
// .map(((x:String) => x.split("\t")) andThen array2Pair) | |
// .map(((_:String).split("\t")) andThen array2Pair) | |
.map( array2Pair _ compose (_.split("\t"))) | |
) { case (l, e) => e :: l } | |
serocs.reverse | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment