Hello all,
My name is Ofer Ron, and I'm a senior data scientist at LivePerson.
Scala's collections library is a very good example of the programming maxim of Don't Repeat Yourself, or DRY. Using Scala's strong type system and orthogonal design principles, it enables code reuse between different collection types, while keeping the API frictionless.
In my talk, which follows the paper "Fighting Bit Rot with Types" (http://lampwww.epfl.ch/~odersky/papers/fsttcs2009.pdf) by the library designers, I demonstrated the principles behind the design, and the type system tricks which enable them.
Video: http://www.parleys.com/play/5281ffc0e4b054cd7d2ef319
16. CanBuildFrom - Using Functional dependencies
object Set {
implicit def canBuildFromSet[B] = new
CanBuildFrom[Set[_], B, Set[B]] {…}
}
object BitSet {
implicit def canBuildFromBitSet[B] = new
CanBuildFrom[BitSet, Int, BitSet] {…}
}
17. Static vs dynamic type
val els:Iterable[Int] = List(1,2,3)
Static type Dynamic type
def map[A,B](els:Iterable[A])(f:A=>B):Iterable[B] = els map f
val newEls:Iterable[String] = map(List(1,2,3))(_.toString)
We want dynamic type list
18. Static vs dynamic type – cnt’d
Compiler will capture: CanBuildFrom[Iterable[_],B,Iterable[B]]
We can follow the call chain to understand how the
correct dynamic type can be created
19. Static vs dynamic type – cnt’d
New Coursera course:
Principles of Reactive Programming
Martin Odersky, Erik Meijer and Roland Kuhn
Nov. 4th, 2013
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether
Global research of 600 consumers’ expectation of help – when purchasing online, 1/3 expect to be helped immediately, whilewhen purchasing online, ¾ expect to be able to access help within 5 minutesif a response is not delivered in the expected timeframe 50% will shop elsewhere online, or abandon altogether