Option in the Scala language is a container for zero or one element of a given type.
I'm using the Option Type's isEmpty method to check if there is no value. I do not want to use …
scala scala-optionSuppose I have a method session.get(str: String): String but you don't know whether it will return you a …
java scala scala-optionUsing Scala 2.7.7: If I have a list of Options, I can flatten them using a for-comprehension: val listOfOptions = List(None, …
scala scala-optionIf I have something like a List[Option[A]] and I want to convert this into a List[A], the …
scala functional-programming scala-optionI'm starting to explore Scala, and one of the things I'm intrigued by is the Option type and the promise …
scala scala-collections scala-optionWhy does this construction cause a Type Mismatch error in Scala? for (first <- Some(1); second <- List(1,2,3)) …
scala for-loop type-mismatch for-comprehension scala-optionMy code is becoming littered with the following code pattern: val opt = somethingReturningAnOpt if (opt.isDefinedAt) { val actualThingIWant = opt.get } …
scala scala-optionWhy using foreach, map, flatMap etc. are considered better than using get for Scala Options? If I useisEmpty I can …
scala scala-optionIs there a way, only using the Scala collection API, to get an Option in a List when trying to …
scala scala-optionHow can I (best) convert an Option returned by a method call into a Try (by preference, although an Either …
scala scala-option