Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment reduce

std/ops/option/block::reduce


Generics

◻ T (any)

Inputs

⇥ none: Block<void>
⇥ value: Block<T>

Outputs

↦ option: Block<Option<T>>


Reduce an option

Takes either value or none and emit the corresponding option.

ℹ️ This treatment aims to be used in conjuction with map.