The ALTernative Language
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Relations

It may not be immediately obvious, but ALT also bolsters a relational algebra (or rather extends it). This example shows why this is the case.

First we encode a tuple with a struct. To create a relation, we union tuples together to create a bag of tuples, just like in SQL. If you don’t want named columns, you can also use a list as a tuple type.

Now we define two (hidden) relations of _A and _B and do some operations on them: