Ask any question about EPFL courses, lectures, exercises, research, news, etc. or try the example questions below.
DISCLAIMER: The Graph Chatbot is not programmed to provide explicit or categorical answers to your questions. Rather, it transforms your questions into API requests that are distributed across the various IT services officially administered by EPFL. Its purpose is solely to collect and recommend relevant references to content that you can explore to help you answer your questions.
Type aliasing is a feature in some programming languages that allows the creation to refer 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. Programing languages which allows type aliasing include C++, D, Dart, Elixir, Elm, F#, Go, Hack, Haskell, Julia, Kotlin, Nim, Python, Rust, Scala, Swift and TypeScript. C++ features type aliasing using the using keyword. using Distance = int; D features type aliasing using the alias keyword. alias Distance = int; Dart features type aliasing using the typedef keyword. typedef Distance = int; Elixir features type aliasing using @type. @type Distance :: integer Elm features type aliasing using type alias. type alias Distance = Int F3 features type aliasing using the type keyword. type Distance = int Go features type aliasing using the type keyword. type Distance int Hack features type aliasing using the newtype keyword. newtype Distance = int; Haskell features type aliasing using the type keyword. type Distance = Int; Julia features type aliasing. const Distance = Int Kotlin features type aliasing using the typealias keyword. typealias Distance = Int Nim features type aliasing. type Distance* = int Python features type aliasing using the typealias keyword. 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. from typing import TypeAlias Vector: TypeAlias = list[float] Rust features type aliasing using the type keyword. type Point = (u8, u8); Swift can create type aliases using opaque types. object Logarithms: opaque type Logarithm = Double Swift features type aliasing using the typealias keyword. typealias Distance = Int; TypeScript features type aliasing using the type keyword.