Create your own Maybe types, customize w/ whatever...
# stdlib
f
Create your own Maybe types, customize w/ whatever higher-order functionality you need, and keep it trim and flat. Voila! Maybe, Either, Result etc. are pretty easy to implement if you need that functionality, so it's no great loss in the end if Optional is crappy. Just makes it frustrating that that's all we got when we could have gotten so much more. Optional makes sense at module boundaries, but isn't necessarily as useful internally. In the end, we simply need a smoother way to represent 'absence of value' in a typesafe way, and Optional doesn't quite cut it. When was the last time you actually needed null to be a valid 'present' value, and thus couldn't wrap it in an Optional? (rare, but possible occurrence)