Product Type
ELI5 — The Vibe Check
A product type is 'this thing has a name AND an age AND an email — all at once.' It's your everyday struct or object. The 'product' comes from math: the total possible values are all combinations multiplied together.
Real Talk
A composite type formed by combining multiple types together, where a value contains ALL of the component values simultaneously. Structs, classes, records, and tuples are all product types. The 'product' refers to the set of possible values being the Cartesian product of the component types.
When You'll Hear This
"A User struct with name:string and age:number is a product type — it has both fields always." / "Product types are the dual of sum types: AND vs OR."
Related Terms
Algebraic Data Types
Algebraic data types are like Lego for type systems.
Record
A record is just another word for a row. Developers love having five words for the same thing to keep you on your toes.
Sum Type
A sum type is 'this thing is EITHER a cat OR a dog OR a fish — pick one.' It's like a multiple choice question for types.