encyclopegia.org

Row polymorphism

In programming language type theory, row polymorphism is a kind of polymorphism that allows one to write programs that are structurally (rather than nominally) polymorphic on record types and/or variants.

In programming language type theory, row polymorphism is a kind of polymorphism that allows one to write programs that are structurally (rather than nominally) polymorphic on record types and/or variants. It may be written as \{\ell_1 : T_1, \dots, \ell_n : T_n, \text{absent}(f_1), \dots, \text{absent}(f_m), \rho\} . This indicates a record type that has fields \ell_i with respective types of T_i (for i = 1 \dots n ), and does not have any of the fields f_j (for j = 1 \dots m ), while \rho expresses the fact the record may contain other fields than \ell_i . Row-polymorphic record types allow us to write programs that operate only on a section of a record. For example, one may define a function that performs some two-dimensional transformation that accepts a record with two or more coordinates, and returns an identical type: \text{transform2d} : \{x : \text{Number}, y : \text{Number}, \rho\} \to \{x : \text{Number}, y : \text{Number}, \rho\} Thanks to row polymorphism, the function may perform two-dimensional transformation on a three-dimensional (in fact, n-dimensional) point, leaving the z coordinate (or any other coordinates) intact. In a more general sense, the function can perform on any record that contains the fields and with type \text{Number} . There is no loss of information: the type ensures that all the fields represented by the variable \rho are present in the return type. In contrast, the type definition \{x : \text{Number}, y : \text{Number}, \mathbf{empty}\} expresses the fact that a record of that type has exactly the and fields and nothing else. In this case, a classic record type is obtained. The record operations of selecting a field r.\ell , adding a field r[\ell:=e] , and removing a field r \backslash \ell can be given row-polymorphic types. \mathrm{select_\ell} = \lambda r. (r.\ell) \;:\; \{ \ell : T, \rho \} \rightarrow T \mathrm{add_\ell} = \lambda r. \lambda e. r[\ell := e] \;:\; \{\mathrm{absent}(\ell), \rho\} \rightarrow T \rightarrow \{\ell : T, \rho\} \mathrm{remove_\ell} = \lambda r. r \backslash \ell \;:\; \{\ell : T, \rho\} \rightarrow \{\mathrm{absent}(\ell), \rho \}

References

No reference rows published for this article.

Cite this article

MLA

"Row polymorphism." encyclopegia.org, 2026, https://encyclopegia.org/wiki/row-polymorphism. Accessed 24 November 2026.

Chicago

"Row polymorphism." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/row-polymorphism.

APA

encyclopegia.org. (2026). Row polymorphism. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/row-polymorphism

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

maximum absolute row sum norm

stub · references available

single-nucleotide polymorphism

stub · references available

lower one-row conjugation

stub · references available

Death Row Records

stub · references available

Radio Row

stub · references available

Cannery Row

stub · references available

Park Row

stub · references available

Kings Row

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1354080776 · 0.5 · snapshot enwiki-001354080776

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.