I have a value which is either Some(x) or None. What is the correct way to use assert to assert that it is Some rather than None. Do I have to use assert(value != None)? I can’t think of an easy way to assert that it is Some(x) for some x.
In the case of Option I can assert that it is not None, but in the case of Either, I might light to assert that it is Right or assert that it is Left.
I think it’s a notation that stems from Java. It just says method nonEmpty in class Option. It’s kind of analogous to type projections (Class#Type) in Scala, only it’s not actually valid syntax for methods.