Idea: shortcut notation for Union{T, Nothing}

It would be nice if Union{T, Nothing} could be notated as T? like in Kotlin, C# etc.

Not necessary but nice to have. Makes the code more compact and readable.

2 Likes

x-ref: https://github.com/JuliaLang/julia/issues/36628 and the linked discourse thread there.

1 Like

Would also be nice to be able to write a type union with a symbol, e.g., |. Thus, Union{T, Nothing} \equiv T | Nothing or something like that.