A Boolean value is one that is either true, or false.
This is a useful concept that crops up in many places. If you want to say "if A then B else C", then A must be a Boolean: true or false.
A Text value (often also known as a string). Text values are enclosing in double quotes: "like this".
Text values are represented using Unicode.
A number (either whole number or not), for example 6 or -7.2
A number may have an attached unit (such as years, or metres per second), written in curly brackets afterwards. To add or subtract two numbers, they must have the same units. Units are tracked through multiplication and division.
Numbers are stored as decimals and addition and subtraction will use decimal (not binary) arithmetic. No guarantees on precision are given on the type or on other operations.
A date, for example 29 August 2008. Only valid dates are allowed (for example, 30 February 2000 is not allowed).
Dates can be entered in expressions using the date{} syntax, for example: date{29 August 2008}.
To avoid confusion over whether the day or month comes first, this type converts to text using the ISO 8601 standard of YYYY-MM-DD, so 29 August 2008 is written 2008-08-29.
This type has no time or timezone attached.
A year and month, for example August 2014, usually written 2014-08. Only valid items are allowed.
This is useful for things like tracking sales for a particular month.
A time of day, for example 10:08. Only valid times are allowed (e.g. 24:02 is not allowed).
The time can feature seconds, including fractional seconds, e.g. 15:04:11.27441.
This type converts to text using the 24-hour clock.
This type has no date or timezone attached.
A date and time of day, for example 2000-01-01 12:34:56.7890
This type has no timezone attached.
A date and time of day, with an attached time zone.
Three letter time zones (e.g. EDT) are avoided for two reasons. Firstly, some of the abbreviations overlap. Secondly, most of these time zones only exist part of the year, meaning that times like 2000-01-01 00:00 BST (British Summer Time) are nonsense, as BST does not exist in January.
Instead, time zones are specified either using continent/major_city notation for geography-based times, or (best of all) an offset from UTC.
A list of items of the same type, written as square brackets around the type, for example [Text] is a list of text values.
If you want a list with items of multiple types, use a tagged type.
A tagged type has one or more tags, each with an optional inner type. A value is one of these tags, with a value if needed.
For example, to represent pricing at a theme park, you might have a tagged type with tags Child, Adult, Senior.
Some tagged types may be flexible in their inner types, in which case they are represented using a type variable. For example, the concept of an optional value occurs often: a value may be missing because a survey respondent didn't fill it in, because some sensor data is missing, because a price is unknown, or because the value is not applicable.
Rather than have a separate tagged type for each inner type, e.g. OptionalBoolean, OptionalText, and so on, we have one Optional type that takes a type variable, so we can have Optional(Boolean) or Optional(Text), and so on.
Units of measurement include things like seconds, kilometres, dollars, users, and so on.
Units are optional -- you can choose to use them or not. They can be useful for two main reasons. First, they provide a reminder of how something is measured -- if you have a column called distance, it is useful to specify whether than is in miles or kilometres. Second, the units are tracked to make sure you do not add two mismatching units (e.g. adding a number in metres per second to a number in miles per hour) and allow you to convert between related units (e.g. inches to metres).
Some functions can take a variety of types. For example, the sort function can take a list of any sortable type: a list of numbers, a list of text values, a list of pairs of dates and numbers, and so on. To denote this, we give the type a generic name, usually t, or a, b, c, which is shown in italics in this interface. You can read this as "any type, which we name t".
Sometimes a type may have constraints on it. These constraints are written above the function's type.