2 ms·
Relevant sections [1] [2] in the Nim Manual might be of interest. Nim has nice type classes and can constrain generics to only apply to one (or a sum type of t
by cb321 6y ago
Relevant sections [1] [2] in the Nim Manual might be of interest. Nim has nice type classes and can constrain generics to only apply to one (or a sum type of them, etc.). It also has concepts [3] that are a sort of compile-time duck-typing construct (under active development).
[1] https://nim-lang.org/1.4.4/manual.html#types https://nim-lang.org/1.4.4/manual.html#types
[2] https://nim-lang.org/1.4.4/manual.html#generics https://nim-lang.org/1.4.4/manual.html#generics
[3] https://nim-lang.github.io/Nim/manual_experimental.html#concepts https://nim-lang.github.io/Nim/manual_experimental.html#conc...