If I have something like a List[Option[A]] an开发者_运维知识库d I want to convert this into a List[A], the standard way is to use flatMap:
Is this开发者_JAVA百科 an opportunity to make things a bit more efficient (for the prorammer): I find it gets a bit tiresome having to wrap things in Some, e.g. Some(5).What about something like this:
I often find myself with an Option[T] for some type T and wish to test the value of the option against some value. For example: