Skip to content

Data Types

Cody Fagley edited this page Jun 6, 2019 · 1 revision

Data Types

This page contains documentation on defining custom data structures, via the XCSL type keyword.


Table of Contents


Arbitrary Types

XCSL tries to emphasize modularity throughout system design, whenever possible. This principle is largely upheld by the internally data type system, especially the concept of Arbitrary Types.

Arbitrary types allow functions to be efficiently built for the base case. Take the following as an example:

  let sum x y = x + y

While many languages require parameters to be explicitly typed, XCSL recognizes that x and y can be any type that implements addition. This leads to a single modular sum function that can interchangeably add integers, real numbers, characters, and booleans.

Clone this wiki locally