##Scala eXchange 2014 slides
collected by Adam Warski
Feel free to complete the list!
The Binary Compatibility Challenge by Martin Odersky
A Skeptic's Look at scalaz' "Gateway Drugs”: A Practical Exploration by Brendand McAdams
| foldLeft(2 :: 3 :: Nil, (0 + 1)) (_ + _) |
| def foldLeft[A,B](as: List[A], b: B)(f: (B, A) => B): B = as match { | |
| case Nil => b | |
| case h :: t => foldLeft(t, f(b, h))(f) | |
| } |
| foldLeft(List(1,2,3), 0)(_ + _) |
| // foldLeft's meaty bit | |
| case Cons(h,t) => foldLeft(t, f(b, h))(f) | |
| // foldRight meaty bit | |
| case Cons(x, xs) => f(x, foldRight(xs, b)(f)) |
| def foldRight[A,B](as: List[A], b: B)(f: (A, B) => B): B = | |
| as match { | |
| case Nil => b | |
| case Cons(x, xs) => f(x, foldRight(xs, b)(f)) | |
| } | |
| foldRight(List(1, 2, 3)) ((x,y) => x + y) | |
| foldRight(Cons(1, Cons(2, Cons(3, Nil))), 0) ((x,y) => x + y) | |
| 1 + foldRight(Cons(2, Cons(3, Nil)), 0) ((x,y) => x + y) | |
| 1 + (2 + foldRight(Cons(3, Nil), 0) ((x,y) => x + y)) |
| foldLeft(List(1,2,3), 0) (_ + _) | |
| foldLeft(Cons(1, Cons(2, Cons(3, Nil))), 0) (_ + _) | |
| foldLeft(Cons(2, Cons(3, Nil)), (0 + 1)) (_ + _) | |
| foldLeft(Cons(3, Nil), ((0 + 1) + 2)) (_ + _) | |
| foldLeft(Nil, (((0 + 1) + 2) + 3)) (_ + _) | |
| (((0 + 1) + 2) + 3)) |
| def foldLeft[A,B](as: List[A], b: B)(f: (B, A) => B): B | |
| as match { | |
| case Nil => b | |
| case Cons(h,t) => foldLeft(t, f(b, h))(f) | |
| } |
##Scala eXchange 2014 slides
collected by Adam Warski
Feel free to complete the list!
The Binary Compatibility Challenge by Martin Odersky
A Skeptic's Look at scalaz' "Gateway Drugs”: A Practical Exploration by Brendand McAdams
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <properties> | |
| <pmd.version>3.0.1</pmd.version> | |
| <cobertura.version>2.5.2</cobertura.version> | |
| <checkstyle.version>2.10</checkstyle.version> | |
| <compileSource>1.7</compileSource> |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <pakaging>war</packaging> | |
| <properties> | |
| <jetty.version>7.6.10.v20130312</jetty.version> | |
| <compileSource>1.7</compileSource> |