Daily scala
A short daily dose of scala examples and occasionally explanations.
Thursday, May 27, 2010
zipWithIndex
›
A common desire is to have access to the index of an element when using collection methods like foreach, filter, foldLeft/Right, etc... For...
8 comments:
Wednesday, May 26, 2010
Return value of a block
›
A common misunderstanding is that a code block (without parameters) is a function. That is not the case. A code block is a sequence of sta...
6 comments:
Thursday, May 20, 2010
Type Inference with Abstract Types
›
A second "gotcha" that one might get tripped up when dealing with abstract types is the signature of the concrete class contains t...
2 comments:
Monday, May 17, 2010
Instance Type (Abstract type gotcha 1)
›
In a previous post about abstract types I showed one of the benefits of using abstract types over parameterized types. Abstract Types vs Pa...
Monday, May 3, 2010
Abstract Types vs Parameter
›
This topic (and the next) are intended to discuss abstract types. A class/trait with an abstract type is quite similar to a class/trait typ...
7 comments:
Thursday, April 29, 2010
Filter with FlatMap (or collect)
›
I picked up this tip from one of Daniel Spiewak's tweets. He tweeted a pro tip that uses flatMap to create a filtered list: list flatMa...
4 comments:
Tuesday, April 27, 2010
Implicit Parameter Resolution
›
This topic is a continuation of the previous implicit parameter topics: Implicit Parameters Companion Object Implicits This topic provides...
1 comment:
‹
›
Home
View web version