JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
88 stars 4 forks source link

Use different union syntax #456

Open JSAbrahams opened 1 year ago

JSAbrahams commented 1 year ago

Current Issue

Typing syntax for union looks a bit like sets, might be a bit confusing.

High-level description of the feature

Use same union syntax as Python, Typescrpt (other?) instead of current, so: def x: {A, B, C ...} := ... changes to def x: A | B | C := ....

This also has the added benefit of being more familiar to uses of those languages. Plus, it just looks better, now we don't mistake it for a set accidentally.

Description of potential implementation