You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to understand (or explain) a type T, I often find myself typing supertype(T), supertype(supertype(T)), supertype(supertype(supertype(T))), etcetera in order to see the type hierarchy. This is tedious and annoying. It would be nice to have a function supertypes(T) that just returned a tuple of T and all its supertypes, e.g.
I guess my feeling is that since it can be static, it should be static (or at least return a tuple type that could be computed statically in a future version), since we can’t change our minds and make it static later if we return an array.
In contrast, the subtypes function cannot be static.
When trying to understand (or explain) a type
T
, I often find myself typingsupertype(T)
,supertype(supertype(T))
,supertype(supertype(supertype(T)))
, etcetera in order to see the type hierarchy. This is tedious and annoying. It would be nice to have a functionsupertypes(T)
that just returned a tuple ofT
and all its supertypes, e.g.Sample implementation:
It could be made to execute completely statically (e.g. is adding
@pure
enough?).The text was updated successfully, but these errors were encountered: