[ruby-core:78119] [Ruby trunk Feature#12933] Add Some and Optional
From:
adam.pahlevi@...
Date:
2016-11-14 06:19:15 UTC
List:
ruby-core #78119
Issue #12933 has been updated by Adam Pahlevi Baihaqi.
Tracker changed from Bug to Feature
Change to feature from bug
----------------------------------------
Feature #12933: Add Some and Optional
https://bugs.ruby-lang.org/issues/12933#change-61483
* Author: Adam Pahlevi Baihaqi
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
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>