3 ms·
That hasn't been my experience, could you show me a small example?
by codygman 13y ago
That hasn't been my experience, could you show me a small example?
- deleted 13y ago[deleted]
- detrino 13y agoIn an HM system there is no overloading so you are essentially naming type constraints on every function call instead of once in the function definition. C++ might look like this: void do_something(bar_t & bar) { ... bar.foo(...); bar.baz(...); auto something = bar.get_something(); ... } The equivalent Ocaml might look like this: let do_something bar = ... Bar.foo bar ...; Bar.baz bar ...; let something = Bar.get_something bar in ... The situation is similar when dealing with structs and tends to be ever worse when dealing with generic code (although C++ only has duck typed generics until concepts comes along).