This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// flatMap | |
// This code is equivalent to: | |
// option.flatMap(foo(_)) | |
option match { | |
case None => None | |
case Some(x) => foo(x) | |
} | |
// flatten | |
// This code is equivalent to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Following switches Spring proxy targeting to classes vs interfaces as default | |
and allows for using Spring annotations (scanning etc) in Scala | |
--> | |
<aop:config proxy-target-class="true"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Controls { | |
type CloseableResource = { def close() } | |
/** | |
* Equivalent of C# using keyword. Automatically closes any resource which has a close method. | |
* Capable of returning a value | |
* @param T resource which has a close() method | |
* @param M result | |
*/ |