How can we emulate variadic templates in Haskell? -
in c++ can define function takes variable number of statically typed arguments, using variadic templates, so:
template<typename... params> void f(params... parameters);
(alternatively have create struct variadic number of fields , used argument f
.)
we can use type traits inspect values. similar in haskell.
i'd define data type , family of functions parameterized number of statically typed arguments:
data t ??? = ... mkt :: ... -> t ??? f :: t ??? -> ...
f
needs able convert parameter types values can generic them (think printf).
perhaps job hlists?
Comments
Post a Comment