Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Type variable, type scheme, parametric polymorphism?

Também chamado de: type variable · type scheme · parametric polymorphism · let-polymorphism

Definition 6.10 University Computer Science — Year 3 · Capítulo 6 — Type Systems and Type Inference

A type variable α\alpha stands for an unknown type; we print them 'a, 'b, …. A type scheme ∀α1…αn. τ\forall \alpha_1 \dots \alpha_n.\,\tau is a type with some of its variables quantified: it stands for every type obtained by replacing them, its instances. A function is parametrically polymorphic if it has a type scheme, one code for all the instances. Let-polymorphism gives schemes to variables bound by let, and only types to variables bound by λ\lambda.

Ler no capítulo →