2 ms·
> I'd like to see a strong opinion on Option<SomeEnum> versus SomeEnum containing a Missing variant. Java $DAYJOB here. If I'm a caller, I probably won't real
by mrkeen 2y ago
> I'd like to see a strong opinion on Option<SomeEnum> versus SomeEnum containing a Missing variant.
Java $DAYJOB here. If I'm a caller, I probably won't realise that SomeEnum.Missing exists. I'll just see that a function accepts a SomeEnum (which I don't have) so I won't call it.
- hardwaresofton 2y agoThis is a good point -- Option<T>is much better in a fn signature for comprehension. This probably clinches it. Funnily enough, Java 1.8 is what really made me start taking Haskell and languages with better type systems more seriously -- seeing that Option actually deserved to be basically everywhere broke my frame.