3 ms·
I'd say that no matter where, but you have to add generic parameters to algorithms to make them reusable across domains. Doing so at type / function level allo
by nine_k 4y ago
I'd say that no matter where, but you have to add generic parameters to algorithms to make them reusable across domains.
Doing so at type / function level allows to introduce them gradually and with low ceremony, compared to parametrized modules (likely you mean OCaml here?). Gradual approaches seem to work best in real world, hence the prevalence of generic functions and parametrized types.
- Rochus 4y ago> likely you mean OCaml here No, I was thinking of Ada or Oberon+. Here is a discussion: https://oberon-lang.github.io/2021/07/17/considering-generics.html https://oberon-lang.github.io/2021/07/17/considering-generic...