Cleaner way of writing functions for multiple types

Disjoint types add incredible complexity to the type system, with very little return. They don't add anything new, either. You could just make a new protocol, extend the desired types to conform to it, then take a value of that protocol type.

Commonly Rejected Changes

Disjunctions (logical ORs) in type constraints: These include anonymous union-like types (e.g. (Int | String) for a type that can be inhabited by either an integer or a string). "[This type of constraint is] something that the type system cannot and should not support."

1 Like