Which type is better?
I was thinking if you already have an Array<T> alias, but I don't really get the context of your question ;)
-
-
It is really about React's children type, which is recursive. However, I'm curious if it is more general than that.
-
If the context is a public API in a dynamic language like JS that changes everything.
-
Compared to a language with e.g. pattern matching on types the usage is quite different.
-
That's just syntax sugar. You end up with a runtime brand check on it regardless. What's the tradeoff?
-
True, but minimal syntax + check for match to be exhaustive are useful. But I can see where this argument is going...
-
And I guess you'd branch on the parametrised type in the other case as well.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.