Issue #12933 has been updated by Yukihiro Matsumoto.

Status changed from Open to Closed

I think it should be implemented in gem (at least for the beginning).
After the gen got popular, we can consider making it standard.

Matz.

----------------------------------------
Feature #12933: Add Some and Optional
https://bugs.ruby-lang.org/issues/12933#change-62556

* Author: Adam Pahlevi Baihaqi
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
What if we have Optional and None as a class, and which we can use like this:

```ruby
have_data = Optional(5).get # returns 5
have_data = Some(nil) # raise error
have_data = Some(operation).expect("cannot be nil") # raise cannot be nil if operation returned nil
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>