Created
October 12, 2016 16:09
-
-
Save griesmey/9f675a115e42e2ea1b60acf0bf14d727 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
def squareList(xs: List[Int]): List[Int] = xs match { | |
case Nil => xs | |
case y :: ys => y * y :: squareList(ys) | |
} | |
def squareList1(xs: List[Int]): List[Int] = | |
xs map (y => y * y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment