Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Product type, sum type, algebraic data type?

También llamado: product type · sum type · algebraic data type

Definition 7.1 University Computer Science — Year 2 · Capítulo 7 — Enums, Pattern Matching and Error Handling

A product type holds one value of each of its component types at once: a tuple (A, B) or a struct. A sum type holds one value of exactly one of its component types, together with which one: a Rust enum. The types built from basic types by products and sums, possibly recursively, are the algebraic data types.

Leer en el capítulo →