3 ms·
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 compi
by dantheman 15y ago
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 http://www.codecommit.com/blog/scala/the-option-pattern