Re:Java 8’s new Optional type doesn't solve anything
by codygman on Monday October 26, 2015 @08:49PM
(#10455496)
The definition in Rust's documentation[0] was this:
The equivalent Haskell if unwrap throws a panic as the docs[0] seem to imply:
You could also do something like this if you don't mind dealing with the wrapped boolean value:
and the failure case:
0: https://doc.rust-lang.org/std/option/enum.Option.html#method...
[ Parent
| on HN ]
Re:Java 8’s new Optional type doesn't solve anything
by steveklabnik on Tuesday October 27, 2015 @08:43AM
(#10457591)
Right, but it's still not unsafe. The stack unwinds, destructors get called.
And I meant some notion of 'safety', not fromMaybe/fromJust.