Created
October 17, 2011 15:29
-
-
Save notyy/1292865 to your computer and use it in GitHub Desktop.
pattern matching haskell vs scala
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
addList :: (Num a) => [(a,a)] -> [a] | |
addList xs = [x + y | (x,y) <- xs] | |
def addList(xs:List[(Int,Int)]): List[Int] = for((x,y) <- xs) yield(x+y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment