Skip to content

0.6.12

Choose a tag to compare

@github-actions github-actions released this 22 Oct 15:03
· 1795 commits to master since this release
7fe19ef
  • for loops over arrays are now converted to more efficient
    index-based iteration (#2831). This can result in significant cycle
    savings for tight loops, as well as slightly less memory usage.

  • Add type union and intersection. The type expression

    T and U

    produces the greatest lower bound of types T and U, that is,
    the greatest type that is a subtype of both. Dually,

    T or U

    produces the least upper bound of types T and U, that is,
    the smallest type that is a supertype of both.

    One use case of the former is "extending" an existing object type:

    type Person = {name : Text; address : Text};
    type Manager = Person and {underlings : [Person]};

    Similarly, the latter can be used to "extend" a variant type:

    type Workday = {#mon; #tue; #wed; #thu; #fri};
    type Weekday = Workday or {#sat; #sun};