Skip to main content Accessibility help
×
Hostname: page-component-7bb8b95d7b-pwrkn Total loading time: 0 Render date: 2024-09-29T02:17:07.626Z Has data issue: false hasContentIssue false

22 - Constructors and Kinds

from Part VII - Variable Types

Published online by Cambridge University Press:  05 February 2013

Robert Harper
Affiliation:
Carnegie Mellon University, Pennsylvania
Get access

Summary

The types nat → nat and nat list may be thought of as being built from other types by the application of a type constructor, or type operator. These two examples differ from each other in that the function space type constructor takes two arguments, whereas the list type constructor takes only one. We may, for the sake of uniformity, think of types such as nat as being built by a type constructor of no arguments. More subtly, we may even think of the types ∀(t · τ) and ∃(t. τ) as being built up in the same way by regarding the quantifiers as higher-order type operators.

These seemingly disparate cases may be treated uniformly by enriching the syntactic structure of a language with a new layer of constructors. To ensure that constructors are used properly (for example, that the list constructor is given only one argument and that the function constructor is given two), we classify constructors by kinds. Constructors of a distinguished kind T are types, which may be used to classify expressions. To allow for multiargument and higher-order constructors, we also consider finite product and function kinds. (Later we consider even richer kinds.)

The distinction between constructors and kinds on one hand and types and expressions on the other reflects a fundamental separation between the static, and the dynamic phase of processing of a programming language, called the phase distinction. The static phase implements the statics, and the dynamic phase implements the dynamics.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2012

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Constructors and Kinds
  • Robert Harper, Carnegie Mellon University, Pennsylvania
  • Book: Practical Foundations for Programming Languages
  • Online publication: 05 February 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9781139342131.023
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Constructors and Kinds
  • Robert Harper, Carnegie Mellon University, Pennsylvania
  • Book: Practical Foundations for Programming Languages
  • Online publication: 05 February 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9781139342131.023
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Constructors and Kinds
  • Robert Harper, Carnegie Mellon University, Pennsylvania
  • Book: Practical Foundations for Programming Languages
  • Online publication: 05 February 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9781139342131.023
Available formats
×