3 ms·
Very strange design. It completely ignores the potential ergonomics of functions over Option<T> like map, unwrap_or, flatten etc that you'd have to implement yo
by awestroke 3y ago
Very strange design. It completely ignores the potential ergonomics of functions over Option<T> like map, unwrap_or, flatten etc that you'd have to implement yourself for every option-imitating enum.
- mathgladiator 3y agoYeah, I agree. My language has both maybe<T> and result<T>, and maybe<T> is exceptionally convenient for all sorts of things. As an example, the result of division is a maybe<double> and I have all the typical operations defined between maybe<double> and double so maybe<double> + double is a maybe<double>. It feels nice to force people to think about the edge conditions of why something isn't present.