Some guys at work wanted to know what was going on in this code:
import scalaz._ import Scalaz._ val x: Option[Int] = whatever val y = ~x // Huh!? |
Some guys at work wanted to know what was going on in this code:
import scalaz._ import Scalaz._ val x: Option[Int] = whatever val y = ~x // Huh!? |
For the past couple of years, we have been using an exercise in various of the training courses we lead, the purpose of which is to show that maintaining too narrow a view during TDD can lead to a very degenerate process and results.
[...]
This is a simple example of use of a mysterious beast called a Kleisli arrow.
[...]
Here is an example of so-called phantom types and covariance in Scala to improve type safety and correctness. The example is a simplified version from a real project.
[...]
Typeclasses, (or type classes), are most famously a language feature of Haskell that has gained interest in the Scala community. Here I describe the basic pattern with references for further study.
[...]
The loan pattern is a common pattern for working with resources that should be closed or otherwise managed after use. It removes responsibility from the developer to manage a resource properly. When loaning several objects, one often ends up with nested functions. Here is a way to flatten that to make things clearer.
[...]
I recently blogged about Functors and mentioned a mysterious beast called Applicative Functor. Here is a simple, complete example that shows how you can use Applicative Functors with the Scalaz library, with references for further reading.
[...]
In the world of functional programming you will quickly come across the concept of a Functor. What I present below is a simple example that might provide some intuition, with references for further reading.
[...]
Over the last few months, we’ve been working on delivering HSBC’s Clearing Connectivity Layer and OTC Cleared Trade Acceptance System. We went live early December, and in fact, we delivered our first release early.
I wanted a very tiny example of using the IO Monad in the brilliant Scalaz library, and here it is.