scala - animeshtrivedi/notes GitHub Wiki
./bin/scala -J-Xmx128g
https://stackoverflow.com/questions/22908662/difference-between-optionvalue-and-somevalue
Option(x)
is basically just saying if (x != null) Some(x) else None
In terms of defining the type used, always use Option[XYZ]. Some(x) and None are just used for the pattern matching to extract the value.
scala> val pf: PartialFunction[Int, Boolean] = { case i if i > 0 => i % 2 == 0}
pf: PartialFunction[Int,Boolean] = <function1>
scala> pf.lift
res1: Int => Option[Boolean] = <function1>
scala> res1(-1)
res2: Option[Boolean] = None
scala> res1(1)
res3: Option[Boolean] = Some(false)
https://stackoverflow.com/questions/17965059/what-is-lifting-in-scala