Every programming language needs a way to construct complex, structured data types. This section introduces the constructs available for doing this in Whiley.
- Primitives – Whiley’s main primitives are
int,real,boolandnull. - Lists – Whiley provides lists, e.g.
[1,2,3], andls[i]. - Sets – Whiley provides sets, e.g.
{1,2,3}. - Maps – Whiley provides maps, e.g.
{1->"Hello World"}. - Tuples – Whiley provides tuples, e.g.
(1,2)is a tuple. - Records – Whiley provides records, e.g.
{input: "test", pos: 0}. - Functions – Whiley provides first-class functions.
An important difference from other languages is that Whiley permits the user to write constraints on types (see this page for more).

Popular Posts