3 ms·
You forgot the best bit... variants and pattern matching!
by boyswan 8y ago
You forgot the best bit... variants and pattern matching!
- skosch 8y agoTrue! I suppose I'm comparing to Elm mainly.
- boyswan 8y agoAlso for your issue with deeply nested options, have a look at this https://medium.com/w3reality/working-with-option-using-maybe-monad-cbb01aedcbf5 https://medium.com/w3reality/working-with-option-using-maybe...
- bam365 8y agoAnd if you don't want to implement the option monad yourself, there's the bs-abstract library, which contains a bunch of category theory definitions and implementations. I have gotten a lot of mileage out of it even in the small amount of ReasonML I have written. That plus ppx_let offers a pretty good monadic programming experience.
- skosch 8y agoThose are both helpful suggestions, thanks guys. I've looked at some of those blog posts and github threads before but haven't tried it out. In the end, however, it's more bolted-on pieces that should be part of the language if you ask me.