In a recent project I had to coalesce quite significant amount of data in the following way. To simplify it for this post, consider that we have the following two lists.
val x
Yay! Finally, I have received the certificate of Functional Programming Principles in Scala course. Thanks @coursera! It has been a great pleasure, and I look forward to the future courses (e.g., Discrete
object Scala99Problem01{
def lastElement[A](ls: List[A]):A = {
def lastElementAux[A](ls: List[A]): Option[A] = ls match{
case Nil => None
case x :: Nil => Some(x)
case x :: xs =>
Yay! Just finished Functional Programming Principles in Scala (with 100% score :D) instructed by Prof. Martin Odersky et al, at Coursera. It has been an excellent experience due to its great content, amazing