-
Notifications
You must be signed in to change notification settings - Fork 22
Closed as not planned
Labels
Description
Nim doesn't allow parameters of generic to be generic themselves. The lack of this feature has come up a few times, sometimes in the context of implementing something from functional programming like a
flatMap or monadic API, and also as with C++ in parameterizing containers. The usual workaround in the
absence of this feature is to pass in only instantiated types to generics.
This feature exists in C++, D, and Scala, and it is one of the highly desired missing features from Rust, see 'higher kinded types', or HKT, where it's perhaps more necessary than in Nim since Rust uses algebraic data types for errors rather than exceptions. Having this, variadic generics, and working static[T], and concepts will close the gap between Nim and C++ 17.
pshirshov, Kazark, zedeus, hugosenari, schneiderfelipe and 1 more