Skip to content

Instantly share code, notes, and snippets.

@notyy
Created October 17, 2011 15:29
Show Gist options
  • Save notyy/1292865 to your computer and use it in GitHub Desktop.
Save notyy/1292865 to your computer and use it in GitHub Desktop.
pattern matching haskell vs scala
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