$type is a compile-time mechanism being called like a function, with a single argument. The compiler evaluates the argument expression and then outputs the type of that expression.
This type is compatible with all class types which means that all classes (not their instances) can be assigned to it. At compile-time,
Class<T> is the common base type of all class types. However, this relation is not reflected in generated code.
This type is useful when an API requires a value to be a class, but not a specific one. This applies to several methods of the Haxe reflection API.
This type is compatible with all enum types. At compile-time,
Enum<T> can be seen as the common base type of all enum types. However, this relation is not reflected in generated code.
On static targets the types
Null<Bool> can be used to allow
null as a value. On dynamic targets this has no effect.
Null<T> can also be used with other types in order to document that
null is an allowed value.
The AST is the result of parsing Haxe code into a typed structure. This structure is exposed to macros through the types defined in the file
haxe/macro/Expr.hx of the Haxe Standard Library.
An accessor method (or short accessor) for a field named
field of type
T is a getter named
get_field of type
Void->T or a setter named
set_field of type
Represents a value which can be either true or false.
A class field is a variable, property or method of a class which can either be static or non-static. Non-static fields are referred to as member fields, so we speak of e.g. a static method or a member variable.
A compiler flag is a configurable value which may influence the compilation process. Such a flag can be set by invoking the command line with
-D key=value or just
-D key, in which case the value defaults to
"1". The compiler also sets several flags internally to pass information between different compilation steps.
A compound type is considered contravariant if its component types can be assigned to less generic components, i.e. if they are only written, but never read.
A compound type is considered covariant if its component types can be assigned to less specific components, i.e. if they are only read, but never written.
Basic types have the following default values on static targets:
0.0on other static targets
Dynamic targets are more lenient with their types and allow
EnumValue is a special type which unifies with all enum instances. It is used by the Haxe Standard Library to provide certain operations for all enum instances and can be employed in user-code accordingly in cases where an API requires an enum instance, but not a specific one.
Expected types occur when the type of an expression is known before that expression has been typed, e.g. because the expression is argument to a function call. They can influence typing of that expression through what is called top-down inference.
Represents a double-precision IEEE 64-bit floating point number.
A type parameter is said to be generic if its containing class or method is generic.
Haxe identifiers start with an underscore
_, a dollar
$, a lower-case character
a-z or an upper-case character
A-Z. After that, any combination and number of
0-9 may follow.
Further limitations follow from the usage context, which are checked upon typing:
A-Zor an underscore
Represents an integral number.
Lambda is a functional language concept within Haxe that allows you to apply a function to a list or iterators. The Lambda class is a collection of functional methods in order to use functional-style programming with Haxe.
The macro context is the environment in which the macro is executed. Depending on the macro type, it can be considered to be a class being built or a function being typed. Contextual information can be obtained through the
All Haxe code is organized in modules, which are addressed using paths. In essence, each .hx file represents a module which may contain several types. A type may be
private, in which case only its containing module can access it.
A general name may refer to
A type in Haxe is considered nullable if
null is a valid value for it.
A field is considered to be physical if it is either
A type can be made private by using the
private modifier. As a result, the type can only be directly accessed from within the module it is defined in.
Private types, unlike public ones, do not become a member of their containing package.
A read access to a field occurs when a right-hand side field access expression is used. This includes calls in the form of
field is accessed to be read.
A static extension allows pseudo-extending existing types without modifying their source. In Haxe this is achieved by declaring a static method with a first argument of the extending type and then bringing the defining class into context through
Static targets employ their own type system where
null is not a valid value for basic types. This is true for the Flash, C++, Java and C# targets.
A String is a sequence of characters.
Structural subtyping defines an implicit relation between types that have the same structure.
The (dot-)path to a type consists of the package, the module name and the type name. Its general form is
The underlying type of an abstract is the type which is used to represent said abstract at runtime. It is usually a concrete (i.e. non-abstract) type but could be another abstract type as well.
Unification between two types A and B is a directional process which answers the question if A can be assigned to B. It may mutate either type if it is or has a monomorph.
Void denotes the absence of a type. It is used to express that something (usually a function) has no value.
A write access to a field occurs when a field access expression is assigned a value in the form of
obj.field = value. It may also occur in combination with read access for special assignment operators such as
+= in expressions like
obj.field += value.