define-type-alias gives a new name to an existing type. It does not make a new type.
Syntax
(define-type-alias ⟨name⟩ ⟨type⟩)
(define-type-alias (⟨name⟩ ⟨var⟩ ...) ⟨type⟩)
Semantics
- Aliases do not create a new type. If
Ais an alias forAA, then one cannot write class instances for bothAandAAsimultaneously. - They are useful for readability, documentation, and local domain naming.
- Parametric aliases must still be fully applied where used.
Example
(define-type-alias (Pair :a) (Tuple :a :a))