O1Library Docs
Fall 2026
Docs API

# option

o1.util.nice.option
object option

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

## Attributes

Graph
Supertypes
  class Object
  trait Matchable
  class Any
Self type
  option.type

## Members list

### 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`.

## 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`

## Attributes

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.

## Attributes