Enhanced standard types for Haxe
- Haxe 4.1+
- JavaScript
- Eval
- NekoVM
- CPP
- Java
- JVM
haxelib install extype
Unit is a type that indicates no value.
Nullable<T> is a wrapper type that can either have a value or null.
Maybe<T> is a wrapper type that can either have a value or none. Maybe<T> looks like haxe.ds.Option<T>, but be annotatted the Default Static Extension (@:using(extype.tools.MaybeTools)).
Result<T, E> is a wrapper type that can either have a value or an error. Result<T, E> looks like haxe.ds.Either<A,B>, but be annotatted the Default Static Extension (@:using(extype.tools.ResultTools)).
Lazy<T> is a value with lazy initialization.
Tuple[2-10] can hold any values of several different types.
Pair<T1, T2> is an alias of Tuple2<T1, T2>.
Map<K, V> is a collection of key/value pairs.
This is a multi-type abstract, it is instantiated as one of its specialization types depending on its type parameters.
- if
Kis aString,extype.map.StringMapis used - if
Kis anInt,extype.map.IntMapis used - if
Kis anEnumValue,extype.map.EnumValueMapis used - if
Kis any other class or structure,extype.map.ObjectMapis used - if
Kis any other type, it causes a compile-time error
Map<K, V> is a collection of key/value pairs. You can iterate through the keys in insertion order.
This is a multi-type abstract, it is instantiated as one of its specialization types depending on its type parameters.
- if
Kis aString,extype.orderedmap.OrderedStringMapis used - if
Kis anInt,extype.orderedmap.OrderedIntMapis used - if
Kis anEnumValue,extype.orderedmap.OrderedEnumValueMapis used - if
Kis any other class or structure,extype.orderedmap.OrderedObjectMapis used - if
Kis any other type, it causes a compile-time error
Set<T> is a set of values.
This is a multi-type abstract, it is instantiated as one of its specialization types depending on its type parameters.
- if
Tis aString,extype.set.StringSetis used - if
Tis anInt,extype.set.IntSetis used - if
Tis anEnumValue,extype.set.EnumValueSetis used - if
Tis any other class or structure,extype.set.ObjectSetis used - if
Tis any other type, it causes a compile-time error
OrderedSet<T> is a set of values. You can iterate through the values in insertion order.
This is a multi-type abstract, it is instantiated as one of its specialization types depending on its type parameters.
- if
Tis aString,extype.orderedset.OrderedStringSetis used - if
Tis anInt,extype.orderedset.OrderedIntSetis used - if
Tis anEnumValue,extype.orderedset.OrderedEnumValueSetis used - if
Tis any other class or structure,extype.orderedset.OrderedObjectSetis used - if
Tis any other type, it causes a compile-time error
LinkedList<T> is doubly linked list implementation.
ReadOnlyArray<T> is a read-only Array<T>.
ReadOnlyDynamic<T> is a read-only Dynamic<T>.
ReadOnlySet<T> is a read-only Set<T>.
ReadOnlyMap<K, V> is a read-only Map<K, V>.
Exception represents the application errors. Exception is the same as haxe.Exception.
NoDataExceptionNotImplementedException
Mixed[2-10] can have a value of several different types.
Mixed2 is a type that likes as haxe.extern.EitherType.
ValueOrArray<T> is a type that likes as extype.extern.Mixed.Mixed2<T, Array<T>>.
ValueOrFunction<T> is the same as extype.extern.Mixed.Mixed2<T, Void->T>.
Extern<T> is a generic-build macro type that can use @:native metadata to the anonymous structure.
extern function defineProperty(name: String, option: Extern<PropertyOption>): Void;
typedef PropertyOption = {
@:native("default")
var defaultValue;
}Indexable<TObject, TValue> is a type that likes as haxe.DynamicAccess<TValue>. But Indexable<TObject, TValue> is different in that can access TObject's field.
- [rename]
Maybe<T>(v2) ->Nullable<T>(v3) - [remove]
Result<T>(v2) - [add]
Maybe<T>(v3) - [add]
Result<T, E>(v3) extype.iteratorpackage has been deprecated. This package was not maintained long time.XxxErrorhas been deprecated. Please useXxxExceptioninstead.