Proposed alias for union types

I do think the demands of generic programming + multiple dispatch + duck-typing make consistent naming relatively more important in Julia than in other languages. Naming is hard, though, and it can indeed be blurry, but in this case, | is firmly documented as a bitwise or, and I maintain that is a very different meaning from a type union.

There have been some very long threads here about what “meaning” itself means — here’s one decent entry-point: Function name conflict: ADL / function merging? - #136 by StefanKarpinski and the subsequent few posts.

So then these considerations get weighted alongside the aesthetic nicety of T | S over Union{T, S}. Is that really worth it? :person_shrugging:

The place where this has been discussed before is in reference to Missing and Nothing — that’s where folks have more commonly run into unions and where (I agree) a shorthand would be nice. Check out:

8 Likes