D 2011-07-15T19:45:31.253 L Types P f3dbfa64f4f3ac5e136733bcfd17ed02f5b34b06 U MauganRa W 1258

Types and the type system

Algebraic types

Blend is based on an algebraic type system. Algebraic types are composed out of other types using constructors. This is also possible with tuples.

List of basic types

Although additional types are scheduled to be implemented, I chose these basic types to implement and make available immediately since they seem to me to be the most important ones.

Integer types:

* Bignum:An integer type with nearly unlimited precision * Int8, Int16, Int32, Int64, Int128: Signed integers with the indicated length * UInt8, UInt16, UInt32, UInt64, UInt128: Unsigned integers with the indicated length * Rational: A rational number of unlimited precision * Float32, Float64: IEEE floating point numbers of different length * Complex32, Complex64: Complex numbers consisting of two IEEE floating point numbers of the appropriate length

Special types:

* Boolean: has two literal values (True and False) which represent truth values * Maybe: Has two constructors (Nothing an Just) which represent either nothing or a value. * Either: Has two constructors, Left and Right. The Left constructor holds an error, the right one a result. Z 175bc01795a5a93b559a0a5ec0c5b9df