3 ms·
You don't really need language features, assuming your language has sum types, polymorphism and first class functions (and why bother using a language that's mi
by lmm 6y ago
You don't really need language features, assuming your language has sum types, polymorphism and first class functions (and why bother using a language that's missing any of those). All you need is some functions, and you can write those yourself since they're just functions. https://fsharpforfunandprofit.com/posts/recipe-part2/ https://fsharpforfunandprofit.com/posts/recipe-part2/
- saghm 6y ago> You don't really need language features, assuming your language has sum types, polymorphism and first class functions (and why bother using a language that's missing any of those). To be fair, this is basically saying "you don't need language features as long as you have these language features".
- lmm 6y agoSure, but those are general language features that you'd want to have for many other reasons anyway. You don't need any option/result-specific language features.
- JackFr 6y ago> You don't really need language features, assuming your language has sum types, polymorphism and first class functions Aren’t those features?
- lmm 6y agoMy point is that Option::ok_or and Option::map aren't language features, they're just plain old functions written in the language; if they weren't there you could implement them yourself. You need some language features to implement them (e.g. you can't implement map without first-class functions), but those are general-purpose language features that you'd want to have anyway.