I have a method that should convert a list to an Option of an object, or None if the list is empty.
Option
None
def listToOption(myList: List[F
Lee's answer is good, but I think this corresponds to the intention a bit more clearly:
Option(myList).filter(_.nonEmpty).map(Bar)