-
Notifications
You must be signed in to change notification settings - Fork 0
Data Types
Cody Fagley edited this page Jun 6, 2019
·
1 revision
This page contains documentation on defining custom data structures, via the XCSL type
keyword.
- Arbitrary Types
- Type Aliases
- Type Constructors
- Complex 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.