flatMap<R extends Object> abstract method

Option<R> flatMap<R extends Object>(
  1. @noFutures Option<R> noFutures(
    1. T value
    )
)

Maps an Option<T> to Option<R> by applying a function that returns another Option.

⚠️ Callback must not throw

Option<R> has no Err variant — there is no slot to record a failure here. If your transformation can fail, use fold or transf (both of which return a Result that can hold an Err), or lift the call via Sync(() => f(value)) to land in the safer Result world.

Implementation

Option<R> flatMap<R extends Object>(
  @noFutures Option<R> Function(T value) noFutures,
);