Knowledge

Product type

Source đź“ť

22: 106:, and the structure of a product type is determined by the fixed order of the operands in the product. An instance of a product type retains the fixed order, but otherwise may contain all possible instances of its 202:-ary product type), and in this case, it characterizes the expressions that behave as tuples of expressions of the corresponding types. A degenerate form of product type is the 51: 564: 935: 569: 559: 554: 542: 443: 720: 73: 44: 693: 374: 184: 810: 615: 547: 509: 305: 996: 710: 640: 488: 121:
If there are only two component types, it can be called a "pair type". For example, if two component types
965: 600: 588: 214: 217:
programming languages, a product type can be interpreted as a set of pairs whose first component is a
898: 850: 762: 740: 735: 663: 529: 483: 369: 359: 275: 226: 161: 34: 772: 436: 218: 146: 38: 30: 925: 840: 668: 524: 478: 233: 173: 55: 221:
in the first type and whose second component is a value in the second type. In short, it is a
658: 633: 991: 460: 87: 408: 8: 986: 930: 908: 835: 688: 680: 429: 339: 188: 169: 107: 913: 893: 845: 820: 605: 574: 347: 198:
The notion directly extends to the product of an arbitrary finite number of types (an
800: 730: 705: 519: 514: 364: 222: 945: 830: 628: 335: 237: 950: 815: 767: 700: 903: 725: 715: 623: 115: 102:
is another, compounded, type in a structure. The "operands" of the product are
980: 825: 396: 384: 207: 782: 338:. Additionally, many functional programming languages provide more general 192: 137:
contains elements that are pairs (a,b), where "a" and "b" are instances of
129:
are the set of all possible values of that type, the product type written
960: 955: 805: 752: 579: 91: 865: 860: 777: 745: 650: 593: 177: 165: 114:, and is called a "tuple type" of expression. A product of types is a 940: 918: 875: 870: 537: 493: 452: 203: 103: 855: 379: 343: 412:, The Univalent Foundations Program, Institute for Advanced Study 421: 164:
type, for which the components of a tuple can be accessed by
111: 110:. The expression of an instance of a product type will be a 473: 400: 410:
Homotopy Type Theory: Univalent Foundations of Mathematics
468: 176:
languages, algebraic data types with one constructor are
145:
respectively. The pair type is a special case of the
160:
In many languages, product types take the form of a
978: 43:but its sources remain unclear because it lacks 334:and the components of a tuple are extracted by 308:. In both these languages, tuples are written 240:of product type. For instance, the product of 437: 444: 430: 74:Learn how and when to remove this message 153:may depend on the instance picked from 979: 425: 187:, product types are associated with 15: 13: 14: 1008: 342:, which extend both product and 20: 375:Struct (C programming language) 451: 1: 510:Arbitrary-precision or bignum 390: 7: 353: 185:Curry–Howard correspondence 10: 1013: 229:in the category of types. 884: 851:Strongly typed identifier 793: 679: 649: 614: 502: 459: 370:Record (computer science) 360:Product (category theory) 168:. In languages that have 346:. Product types are the 225:and it corresponds to a 29:This article includes a 926:Parametric polymorphism 58:more precise citations. 234:functional programming 174:functional programming 118:of two or more types. 88:programming languages 997:Composite data types 340:algebraic data types 170:algebraic data types 108:primitive data types 931:Primitive data type 836:Recursive data type 689:Algebraic data type 565:Quadruple precision 208:product of no types 189:logical conjunction 180:to a product type. 147:dependent pair type 894:Abstract data type 575:Extended precision 534:Reduced precision 31:list of references 974: 973: 706:Associative array 570:Octuple precision 365:Cartesian product 236:languages have a 223:cartesian product 149:, where the type 84: 83: 76: 1004: 946:Type constructor 831:Opaque data type 763:Record or Struct 560:Double precision 555:Single precision 446: 439: 432: 423: 422: 336:pattern-matching 333: 324: 320: 311: 303: 294: 290: 281: 267: 263: 238:primitive notion 79: 72: 68: 65: 59: 54:this article by 45:inline citations 24: 23: 16: 1012: 1011: 1007: 1006: 1005: 1003: 1002: 1001: 977: 976: 975: 970: 951:Type conversion 886: 880: 816:Enumerated type 789: 675: 669:null-terminated 645: 610: 498: 455: 450: 416:See section 1.5 393: 356: 331: 329: 322: 318: 316: 309: 301: 299: 292: 288: 286: 279: 272: 265: 261: 259: 252: 245: 80: 69: 63: 60: 49: 35:related reading 25: 21: 12: 11: 5: 1010: 1000: 999: 994: 989: 972: 971: 969: 968: 963: 958: 953: 948: 943: 938: 933: 928: 923: 922: 921: 911: 906: 904:Data structure 901: 896: 890: 888: 882: 881: 879: 878: 873: 868: 863: 858: 853: 848: 843: 838: 833: 828: 823: 818: 813: 808: 803: 797: 795: 791: 790: 788: 787: 786: 785: 775: 770: 765: 760: 755: 750: 749: 748: 738: 733: 728: 723: 718: 713: 708: 703: 698: 697: 696: 685: 683: 677: 676: 674: 673: 672: 671: 661: 655: 653: 647: 646: 644: 643: 638: 637: 636: 631: 620: 618: 612: 611: 609: 608: 603: 598: 597: 596: 586: 585: 584: 583: 582: 572: 567: 562: 557: 552: 551: 550: 545: 543:Half precision 540: 530:Floating point 527: 522: 517: 512: 506: 504: 500: 499: 497: 496: 491: 486: 481: 476: 471: 465: 463: 457: 456: 449: 448: 441: 434: 426: 420: 419: 406: 392: 389: 388: 387: 382: 377: 372: 367: 362: 355: 352: 350:of sum types. 327: 314: 297: 284: 270: 257: 250: 243: 116:direct product 82: 81: 39:external links 28: 26: 19: 9: 6: 4: 3: 2: 1009: 998: 995: 993: 990: 988: 985: 984: 982: 967: 964: 962: 959: 957: 954: 952: 949: 947: 944: 942: 939: 937: 934: 932: 929: 927: 924: 920: 917: 916: 915: 912: 910: 907: 905: 902: 900: 897: 895: 892: 891: 889: 883: 877: 874: 872: 869: 867: 864: 862: 859: 857: 854: 852: 849: 847: 844: 842: 839: 837: 834: 832: 829: 827: 826:Function type 824: 822: 819: 817: 814: 812: 809: 807: 804: 802: 799: 798: 796: 792: 784: 781: 780: 779: 776: 774: 771: 769: 766: 764: 761: 759: 756: 754: 751: 747: 744: 743: 742: 739: 737: 734: 732: 729: 727: 724: 722: 719: 717: 714: 712: 709: 707: 704: 702: 699: 695: 692: 691: 690: 687: 686: 684: 682: 678: 670: 667: 666: 665: 662: 660: 657: 656: 654: 652: 648: 642: 639: 635: 632: 630: 627: 626: 625: 622: 621: 619: 617: 613: 607: 604: 602: 599: 595: 592: 591: 590: 587: 581: 578: 577: 576: 573: 571: 568: 566: 563: 561: 558: 556: 553: 549: 546: 544: 541: 539: 536: 535: 533: 532: 531: 528: 526: 523: 521: 518: 516: 513: 511: 508: 507: 505: 501: 495: 492: 490: 487: 485: 482: 480: 477: 475: 472: 470: 467: 466: 464: 462: 461:Uninterpreted 458: 454: 447: 442: 440: 435: 433: 428: 427: 424: 417: 413: 411: 407: 405: 403: 398: 395: 394: 386: 385:Quotient type 383: 381: 378: 376: 373: 371: 368: 366: 363: 361: 358: 357: 351: 349: 345: 341: 337: 330: 317: 307: 300: 287: 277: 273: 260: 253: 246: 239: 235: 230: 228: 224: 220: 216: 215:call-by-value 211: 209: 205: 201: 196: 194: 190: 186: 181: 179: 175: 172:, as in most 171: 167: 163: 158: 156: 152: 148: 144: 140: 136: 132: 128: 124: 119: 117: 113: 109: 105: 101: 97: 93: 89: 78: 75: 67: 57: 53: 47: 46: 40: 36: 32: 27: 18: 17: 757: 731:Intersection 415: 409: 401: 397:product type 325: 312: 295: 282: 268: 255: 248: 241: 231: 212: 206:: it is the 199: 197: 182: 159: 154: 150: 142: 138: 134: 130: 126: 122: 120: 99: 95: 85: 70: 64:October 2020 61: 50:Please help 42: 992:Type theory 961:Type theory 956:Type system 806:Bottom type 753:Option type 694:generalized 580:Long double 525:Fixed point 254:is written 92:type theory 56:introducing 987:Data types 981:Categories 866:Empty type 861:Type class 811:Collection 768:Refinement 746:metaobject 594:signedness 453:Data types 391:References 178:isomorphic 941:Subtyping 936:Interface 919:metaclass 871:Unit type 841:Semaphore 821:Exception 726:Inductive 716:Dependent 681:Composite 659:Character 641:Reference 538:Minifloat 494:Bit array 344:sum types 204:unit type 191:(AND) in 966:Variable 856:Top type 721:Equality 629:physical 606:Rational 601:Interval 548:bfloat16 380:Sum type 354:See also 909:Generic 885:Related 801:Boolean 758:Product 634:virtual 624:Address 616:Pointer 589:Integer 520:Decimal 515:Complex 503:Numeric 399:at the 306:Haskell 247:, ..., 227:product 183:In the 96:product 52:improve 899:Boxing 887:topics 846:Stream 783:tagged 741:Object 664:String 162:record 794:Other 778:Union 711:Class 701:Array 484:Tryte 232:Most 219:value 193:logic 166:label 112:tuple 104:types 100:types 37:, or 914:Kind 876:Void 736:List 651:Text 489:Word 479:Trit 474:Byte 348:dual 296:type 283:type 278:and 269:type 256:type 249:type 242:type 141:and 125:and 94:, a 90:and 773:Set 469:Bit 404:Lab 321:... 304:in 291:... 274:in 264:... 213:In 98:of 86:In 983:: 414:. 276:ML 210:. 195:. 157:. 133:× 41:, 33:, 445:e 438:t 431:v 418:. 402:n 332:) 328:n 326:v 323:, 319:, 315:1 313:v 310:( 302:) 298:n 293:, 289:, 285:1 280:( 271:n 266:* 262:* 258:1 251:n 244:1 200:n 155:A 151:B 143:B 139:A 135:B 131:A 127:B 123:A 77:) 71:( 66:) 62:( 48:.

Index

list of references
related reading
external links
inline citations
improve
introducing
Learn how and when to remove this message
programming languages
type theory
types
primitive data types
tuple
direct product
dependent pair type
record
label
algebraic data types
functional programming
isomorphic
Curry–Howard correspondence
logical conjunction
logic
unit type
product of no types
call-by-value
value
cartesian product
product
functional programming
primitive notion

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑