Type alias
A type alias is a declaration that gives a type or type expression an alternative name without introducing a distinct nominal type.
Essential TypeScript 5, Third Edition
A type alias is a named TypeScript type definition that can represent an existing type or a composed type.
- How it is used
- Names reusable type definitions to reduce duplication in function signatures, object shapes, and application data schemas.
- How deep it goes
- Defines the syntax and works through several applications, while noting that an alias does not change compiler treatment.
- Examples
- Uses item counts, product arrays, city strings, a Lowdb task schema, and objects created by a constructor function.
- What you can do after
- Apply it via TypeScript annotations and assertions to reuse type definitions and check shaped application data.
Read how Essential TypeScript 5, Third Edition explains type alias →
Go in Action, Second Edition
A type alias gives an existing type an alternate name without creating a distinct type.
- How it is used
- Distinguishes alternate names for existing types from distinct defined types, and gives common integer values more meaningful names.
- How deep it goes
- Defines alias syntax and interchangeability, contrasting aliases with distinct defined types and their ability to have methods.
- Examples
- Uses `byte` as an alias for `uint8` and `rune` as an alias for `int32`.
- What you can do after
- Evaluate/understand when an alternate type name remains interchangeable rather than creating a distinct type.
Learn Haskell by Example
A type synonym gives an existing type an alternate name without creating a distinct representation or type identity.
- How it is used
- Clarifies the intended role of ordinary representations such as character lists, filenames, and strings.
- How deep it goes
- Defines aliases, demonstrates interchangeability, and stops short of creating a distinct type identity.
- Examples
- Uses Alphabet for cipher alphabets, FilePath for command-line filenames, and GHCi commands for inspection.
- What you can do after
- Apply type synonyms in Haskell code and inspect their resulting values and signatures through GHCi.
Kotlin in Action, 2E
A type alias is a Kotlin declaration that gives an alternative name to an existing type without creating a distinct type.
- How it is used
- Improves readability by naming long generic or functional types without changing how those types behave.
- How deep it goes
- Explains declaration syntax, usage, tradeoffs, and compile-time expansion, but stops short of adding type safety.
- Examples
- Uses the NameCombiner functional alias and contrasts a ValidatedInput alias with a value class.
- What you can do after
- Apply it by naming repeated complex types while recognizing when a distinct value class is required for stronger type separation.
Type-Driven Development with Idris
A type synonym is an alternative name for an existing type, often chosen to make the type's meaning clearer.
- How it is used
- Clarifies composite types with descriptive names and supports calculating types from inputs.
- How deep it goes
- Defines simple and parameterized synonyms, then demonstrates their evaluation and use with interactive editing tools.
- Examples
- Uses coordinate pairs and a triangle represented as a vector of positions.
- What you can do after
- Apply it by naming coordinate pairs Position and vectors of positions Polygon n.
Read how Type-Driven Development with Idris explains type alias →
Learn C++ by Example
A type alias is a declaration that gives an existing type an alternative name.
- How it is used
- Defines a readable name for a custom std::chrono duration used in practical time conversions.
- How deep it goes
- Defines the using form through a century-duration example and defers broader details about using to later coverage.
- Examples
- Uses a centuries alias to represent two hundred years and convert that duration into seconds, hours, and days.
- What you can do after
- Build it from scratch by naming a parameterized chrono duration with using and applying the alias in conversions.
Modern C
A type alias is an alternative name for an existing C type that does not create a distinct type.
- How it is used
- Introduces readable names for existing C types, especially structures and arrays.
- How deep it goes
- Explains alias identity, structure forward declarations, array syntax, and _t reservation rules.
- Examples
- Uses multidimensional double arrays, staged array aliases, structure declarations, and size_t as examples.
- What you can do after
- Apply it via typedef to name existing structures, arrays, and other C types without changing their identities.
Related concepts
- typedefproduced by · typedef is a C and C++ declaration mechanism that introduces an alternative name for an existing type.
- type-level functionkind of · A function whose input and output are evaluated or interpreted in type positions to determine types.
- newtype idiomcontrasts with · The newtype idiom creates a distinct type by wrapping an existing type, giving its values separate type-level identity while typically preserving their underlying representation.
- atomic typecontrasts with · An atomic type is a type whose supported accesses and operations are indivisible with respect to concurrent execution and provide defined synchronization semantics.
- functionkind of · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






