c3d / xl

A minimalist, general-purpose programming language based on meta-programming and parse tree rewrites
GNU General Public License v3.0
270 stars 15 forks source link

Implement type expressions #12

Open c3d opened 4 years ago

c3d commented 4 years ago

Implement type expressions as documented.

The most important types are:

Internally, the compiler currently generates very basic union types using the | operator.

Ideally, we would be able to implement all this in the library only, once the type interface (issue #11) is properly defined. For example:

type T1 or T2 is
    contains Value is T1.contains Value or T2.contains Value