Because Seq also implements PartialFunction, it has an apply method (the Function trait defines an apply method), and it’s a partial function from Int to an element. The reason it’s partial is because for all values of Int you may not have elements in the collection.
- Chapter 4. Having fun with functional data structures
- from Scala in Action
- Publisher: Manning Publications
- Released: April 2013
Share this highlighthttp://www.safaribooksonline.com/a/scala-in-action/9515/