GreanTech/Qaiain — pull request #26 by moodmosaic (2014-07-22 07:47:31+00:00)
Title: A more precise return type for the handle function

Although the `handle` function in the `Mail` module returns `Unit` it can also throw exception in the case of an unknown message type.

We should change the return type from `Unit` to something that includes the case of failure, something like:
* [Try](http://www.scala-lang.org/files/archive/nightly/docs/library/index.html#scala.util.Try) in Scala
* [Either](https://hackage.haskell.org/package/base-4.7.0.1/docs/Data-Either.html) in Haskell
* [Choice](http://msdn.microsoft.com/en-us/library/ee353439.aspx) in F# - although in my opinion it's extremely undescriptive

This Pull Request changes the `handle` function in the `Mail` module to return:
```
Either
```

If we take this direction, we can probably use the introduced `Either` type as the monadic value in #6.