Open ianks opened 9 years ago
did you try Maybe(nil).value_or SomeObject.new ?
Piotr
On 20 Aug 2015, at 00:55, Ian Ker-Seymer notifications@github.com wrote:
I would like to be able to do somehting like this
Maybe(nil).match do Some(s) { |v| s } None(n) { |v| SomeObject.new } end Is this possible/is there a better pattern than this for having this behavior?
— Reply to this email directly or view it on GitHub.
I would like to be able to do somehting like this
Is this possible/is there a better pattern than this for having this behavior?