Re:Don't return null; use a tail call
by dantheman on Tuesday January 10, 2012 @10:01AM
(#3447133)
Scala has the Option/Some type, IIRC based on Haskell's Maybe, where it's used as: Option(int), and then you check the return for None or Some(int). The compiler should catch when you forget to cover the None case.
Here's a good little tutorial: http://www.codecommit.com/blog/scala/the-option-pattern