encyclopegia.org

Type aliasing

Type aliasing is a feature in some programming languages that allows creating a reference to a type using another name. It does not create a new type hence does not increase type safety. It can be used to shorten a long name. Languages allowing type aliasing include: C++, C# Crystal, D, Dart, Elixir, Elm, F#, Go, Hack, Haskell, Julia, Kotlin, Nim, OCaml, Python, Rust, Scala, Swift and TypeScript.

Type aliasing is a feature in some programming languages that allows creating a reference to a type using another name. It does not create a new type hence does not increase type safety. It can be used to shorten a long name. Languages allowing type aliasing include: C++, C# Crystal, D, Dart, Elixir, Elm, F#, Go, Hack, Haskell, Julia, Kotlin, Nim, OCaml, Python, Rust, Scala, Swift and TypeScript. using Distance = int; using Distance = int; alias Distance = Int32; alias Distance = int; typedef Distance = int; @type Distance :: integer type alias Distance = Int type Distance = int Go features type aliasing using the type keyword and = . type Distance = int newtype Distance = int; type Distance = Int; const Distance = Int typealias Distance = Int type Distance* = int type distance = int Vector = list[float] Type aliases may be marked with TypeAlias to make it explicit that the statement is a type alias declaration, not a normal variable assignment. The use of (from PEP 613) is not required for the alias to function, but it explicitly tells static type checkers (like Mypy) that the assignment is a type declaration, not a runtime variable assignment. from typing import TypeAlias Vector: TypeAlias = list[float] type Point = (u8, u8); object Logarithms: opaque type Logarithm = Double typealias Distance = Int; type Distance = number; const distance = u32;

References

No reference rows published for this article.

Cite this article

MLA

"Type aliasing." encyclopegia.org, 2026, https://encyclopegia.org/wiki/type-aliasing. Accessed 24 November 2026.

Chicago

"Type aliasing." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/type-aliasing.

APA

encyclopegia.org. (2026). Type aliasing. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/type-aliasing

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

Related articles

blood type

stub · references available

Type 69 tank

stub · references available

solar-type star

stub · references available

Adobe Type

stub · references available

Audi Type B

stub · references available

Audi Type G

stub · references available

Audi Type M

stub · references available

Audi Type SS

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

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.