All Downloads are FREE. Search and download functionalities are using the official Maven repository.

es.weso.utils.OptionListUtils.scala Maven / Gradle / Ivy

The newest version!
package es.weso.utils

object OptionListUtils {

  def maybeAddList[A](maybeList: Option[List[A]], other: List[A]): Option[List[A]] =
    if (other.isEmpty) maybeList
    else
      maybeList match {
        case None     => Some(other)
        case Some(ls) => Some(ls ++ other)
      }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy