1
$\begingroup$

What is the formal name in type theory of the operation that creates a "matrix of types" from product types (such as std::tuple in C++)?

For example if we consider std::tuple<int, float, char> t1 and std::tuple<std::string, double> t2 (in C++, but the same question remains for any product type in any language), what would the name of the operation that would construct the following matrix of product types:

  • int, std::string
  • int, double
  • float, std::string
  • float, double
  • char, std::string
  • char, double
$\endgroup$
  • $\begingroup$ What do you mean by "matrix of types"? Perhaps provide an example. $\endgroup$ – Dave Clarke Jun 5 '17 at 6:42
  • $\begingroup$ That is a type containing the tuples I listed (6 product types with 2 values each) $\endgroup$ – Vincent Jun 5 '17 at 8:33
  • $\begingroup$ That's just a tuple of tuples. $\endgroup$ – Derek Elkins left SE Jun 5 '17 at 9:24
  • $\begingroup$ I am more speaking of the operation, not the type $\endgroup$ – Vincent Jun 5 '17 at 17:56
  • $\begingroup$ Do you mean? std::tuple<std::tuple<int, std::string>, std::tuple<int, double>, std::tuple<float, std::string>, std::tuple<float, double>, std::tuple<char, std::string>, std::tuple<char, double>>? $\endgroup$ – Dave Clarke Jun 5 '17 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.