What would be the proper effect to represent getting the first element of a list, such as a list of tweets? What about a user's information from the database for a given userId?
What are the range of possible values of the following expression: Option(scala.util.Random.nextInt(10)).fold(9)(_-1)?
What will be the result of the following expression?
Try[Int](throw new OutOfMemoryError()).filter(_ > 10).recover { case _: OutOfMemoryError => 100 }
Describe the result of the following expression:
Future[Int](throw new OutOfMemoryError()).filter(_ > 10).recover { case _: OutOfMemoryError => 100 }(20)
Given the following function, what would be the result of the following call:either(1)?
def either(i: Int): Boolean = Either.cond(i > 10, i * 10, new IllegalArgumentException("Give me more")).forall(_ < 100)