Class-like syntax for union type aliases and natural docstrings

That was in the context of the thread proposing C-like variable annotation syntax such as int foo = 10. That’s what I meant when I said I disliked type name = value.

I later clarified this because someone else had the same confusion, evidently my phrasing was pretty poor!

As for the type statement itself, I have no issues with the current syntax. It also seems to be the convention in several other modern languages:

Rust:       type Result<T> = ...;
TypeScript: type Result<T> = ...;
Go:         type Result[T any] = ...;
Python:     type Result[T] = ...
2 Likes