option

object option

Provides nice extensions to the interface of scala.Option, for convenience.

class Object
trait Matchable
class Any
option.type

Extensions

Extensions

extension [Content](self: Option[Content])
def log(format: String => String, describeContent: Content => String, describeNone: => String): Option[Content]

Prints out a report of the Option’s contents (if any). Returns the unmodified Option.

Prints out a report of the Option’s contents (if any). Returns the unmodified Option.

Value parameters:
describeContent

a function that takes in an Option’s contents and produces a description of it; defaults to _.toString

describeNone

a description of an empty Option; defaults to "None"

format

a function that takes in a description of an Option and produces a report of it; defaults to identity

def tap(effect: Content => Unit): Option[Content]

Performs a given side effect on the Option’s contents (if any). Returns the Option as is.

Performs a given side effect on the Option’s contents (if any). Returns the Option as is.