# Std proposal: Option::fold()

**URL:** <https://internals.rust-lang.org/t/std-proposal-option-fold/9328>\
**Category:** Uncategorized\
**Created:** [February 2, 2019, 12:50pm UTC](https://internals.rust-lang.org/t/std-proposal-option-fold/9328 "2019-02-02T12:50:04Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [February 2, 2019, 5:43pm UTC](https://internals.rust-lang.org/t/std-proposal-option-fold/9328/3 "2019-02-02T17:43:51Z")

</div>

Previous discussion:

> [@Lifting binary operations, e.g. T+T → Option\<T\> + Option\<T\>](https://internals.rust-lang.org/t/lifting-binary-operations-e-g-t-t-option-t-option-t/6618/23):
>
> Is there a simple way today to get the other kind lift, which turns a binary operation on T into a binary operation on Option\<T\>, respecting the new identity element None? fn lift\<T, F: FnOnce(T, T) -\> T\>( f: F, left: Option\<T\>, right: Option\<T\>) -\> Option\<T\> { match (left, right) { (None, right) =\> right, (left, None) =\> left, (Some(left), Some(right)) =\> Some(f(left, right)), } } This does the right thing for std::cmp::min, std::cmp::max. I think this is …

---

_[View the full topic](https://internals.rust-lang.org/t/std-proposal-option-fold/9328)._
