Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Product type, sum type, algebraic data type » ?

Aussi appelé : product type · sum type · algebraic data type

Definition 7.1 University Computer Science — Year 2 · Chapitre 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.

Lire dans le chapitre →