Skip to content

Instantly share code, notes, and snippets.

@alexy
Created April 20, 2012 05:33
Show Gist options
  • Save alexy/2426320 to your computer and use it in GitHub Desktop.
Save alexy/2426320 to your computer and use it in GitHub Desktop.
compose method and function
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