In this James Irie blog, he writes:
In addition, Scala has an “option” method that advances the value of either Some (value) or None, depending on whether it is null or not ...
I cannot find this method optionanywhere in scaladoc.
Iulian Dragos The gdata client project contains a method that probably applies to James.
def option[A <: AnyRef](a: A): Option[A] =
if (a eq null) None else Some(a)
Indicate where I can find this method in scaladoc.
PS I have a method that looks like this:
def permutations(s: String): List[String] = ...
I am in two minds as to whether I should change it to:
def permutations(s: Option[String]): List[String] = ...
null. String, , option, .