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
I'm a fan of row polymorphism. I actually tried to get this in about six months ago.
Unfortunately, this would mean the type checker would always have to delay type checking interface bodies, and instead stamp them out individually and check them at each unique instantiation. This is pretty inefficient. Separate type checking, where you can reason about the body of the interface separate from its eventual instantiation, is much preferred.
That's too bad, since "runtime row polymorphism" happens a lot in Javascript (by its dynamic nature), and we currently can't model that generically in Typescript IMO.
It would be very nice have real extensible row polymorphism in Typescript, that also works with generics.
So having type constructions that allow adding and removing 'keys' aka labels.
I tried adding labels using interfaces, but that does not work, since you cannot extend from a generic type?
See Microsoft's research language Koka and also this old paper, both from Daan Leijen
The text was updated successfully, but these errors were encountered: