encyclopegia.org

Polymorphic recursion

In computer science, polymorphic recursion (also referred to as Milner–Mycroft typability or the Milner–Mycroft calculus) refers to a recursive parametrically polymorphic function where the type parameter changes with each recursive invocation made, instead of staying constant. Type inference for polymorphic recursion is equivalent to semi-unification and therefore undecidable and requires the use of a semi-algorithm or programmer-supplied type annotations.

In computer science, polymorphic recursion (also referred to as Milner–Mycroft typability or the Milner–Mycroft calculus) refers to a recursive parametrically polymorphic function where the type parameter changes with each recursive invocation made, instead of staying constant. Type inference for polymorphic recursion is equivalent to semi-unification and therefore undecidable and requires the use of a semi-algorithm or programmer-supplied type annotations. data Nested a = a : A length function defined over this datatype will be polymorphically recursive, as the type of the argument changes from Nested a to Nested [a] in the recursive call: length :: Nested a -> Int length Epsilon = 0 length (_ : Note that Haskell normally infers the type signature for a function as simple-looking as this, but here it cannot be omitted without triggering a type error. Richard Bird and Lambert Meertens (1998). "Nested Datatypes". C. Vasconcellos, L. Figueiredo, C. Camarao (2003). "Practical Type Inference for Polymorphic Recursion: an Implementation in Haskell ". Journal of Universal Computer Science. L. Figueiredo, C. Camarao. "Type Inference for Polymorphic Recursive Definitions: a Specification in Haskell".

References

No reference rows published for this article.

Cite this article

MLA

"Polymorphic recursion." encyclopegia.org, 2026, https://encyclopegia.org/wiki/polymorphic-recursion. Accessed 24 November 2026.

Chicago

"Polymorphic recursion." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/polymorphic-recursion.

APA

encyclopegia.org. (2026). Polymorphic recursion. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/polymorphic-recursion

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

Related articles

Beth Van Fleet

enwiki · references available

HartBeat Ensemble

enwiki · references available

Michael O'Brien (Fianna Fáil politician)

enwiki · references available

Caravan Palace

enwiki · references available

Dobson Collins

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

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.