Felix has a large set of data types lifted from C and C++. In general is lifted from C with a type binding in the library like this:
type int = "int";
Polymorphic types can be lifted too:
type vector[T] = "vector<?1>";
Felix requires all types to be first class, that is, to provide a default constructor, copy constructor, destructor, and assignment operator. Second class types can be represented by pointers.
address, bool, char, string
tiny, short, int, long, vlong utiny, ushort, uint, ulong, uvlong ptrdiff, intmax, intptr size, uintmax , uintptr int8, int16, int32, int64 uint8, uint16, uint32, uint64
float, double, ldouble complex, dcomplex, lcomplex quaternion
Stl data types work with any C data type, or any Felix product thereof. They will not work with pointers to the Felix heap or any type containing them, since the Garbage Collector cannot see into STL data types.
3 Nominal type constructors
Specify types by name. Felix provides struct and union types. Enum is a special case of a union.
4 Structural types
Anonymous types. Felix provides unit, tuple, array, record, void, sum, variant, pointer, function type, and C-function types.
5 Library types
Felix provides a structurally typed compile time fixed length array type, and the library provides
- varray (run time bounded variable length array),
- darray (unbounded variable length array),
- sarray (unbounded sparse array),
- bsarray (bounded sparse array), and
We also have carray, a pointer to an indeterminate number of elements.
- sexpr (a tree structured based on Scheme S-expressions),
- assoc_list (a list of pairs),
- ralist (Okasaki's purely functional random access list),
- strdict (a dictionary with string keys based on JudySLArray),
- json (a tree based on JSON specification)