Variadic Generics
Here there are some informations about what can / should be done to implement this, but I don’t know if the information is stale as of today. The key is to proceed step by step, implementing one piece...
View ArticleVariadic Generics
@technicated the proposal is great! The cool thing about variadic generics is building recursive types and data structures, something like struct Recursive<Head, variadic Tail> { var head: Head...
View ArticleVariadic Generics
Alexey_Komnin: The problem is, there should exist a terminal type defined or some kind of condition ti stop the recursion. How would you suggest to handle this? If you cannot initialize a value of...
View ArticleVariadic Generics
I've just thrown out an idea in the thread mentioned by @technicated . A basic idea could be that variadic types are always declared in terms of at least two types, like this: @variadic(S,T) func...
View ArticleVariadic Generics
There is always a finite number of generic parameters, isn't it? Yet recursion always needs a terminal condition. The value of variadic generics is doubtful if there is no support for recursion. Read...
View ArticleVariadic Generics
This is something I thought about and could not find a solution i.e. what happens when Tail is emptied going down into the recursion? What is Head going to be? This kind of code should be a compile...
View ArticleVariadic Generics
technicated: What is Head going to be? Head is always safe as it isn't splatted. technicated: This kind of code should be a compile error? Unfortunately, yes. As in the last call of Recursive no...
View ArticleVariadic Generics
DevAndArtist: technicated: We might also want to seek some guidance from the Core Team! Definitely from @Douglas_Gregor as he co-authored this paper: http://www.jot.fm/issues/issue_2008_02/article2/...
View ArticleVariadic Generics
But today Swift does not allow for this: two types with the same name and different generic parameters cause an error: invalid redeclaration of ‘Recursive’, so this would need to be special-cased...
View ArticleVariadic Generics
I thought about yet another problem. In the current git repo for the proposal, it is mentioned that the variadic type should conform to Collection. But what the hell would MyVariadicType.Element be?...
View ArticleVariadic Generics
No, I often use Collection as a constraint but only in the #head, #tail, #length, #reduce, #ifempty section I suggest to explore (not super convinced) what can happen, what we gain and what can go...
View ArticleVariadic Generics
It's a super essential feature. If no one can take it over we need help from the core team, don't we? Can we help with prioritization or something? We're about to have Swift 6 and so sad to see than...
View ArticleVariadic Generics
technicated: But today Swift does not allow for this: two types with the same name and different generic parameters cause an error: invalid redeclaration of ‘Recursive’ , so this would need to be...
View ArticleVariadic Generics
If Swift is going to evolve this way, something similar to SFINAE has to be introduced, and it would increase the complexity significantly. Read full topic
View ArticleVariadic Generics
I spent some time playing with different applications of the variadic usage, and I think there should exist some set of operations defined on the variadic type. For example, it is essential to compare...
View ArticleVariadic Generics
I think the opposite it's truth, if we automatically convert errors to properly working code we end up with a lot of ambiguous meanings over time. Okay I understand a bit what you mean but SFINAE...
View ArticleVariadic Generics
Alexey_Komnin: The main question I am not able to solve, what is an empty variadic? @technicated, in your proposal you declare an empty variadic syntax - "<>" and show it is possible to define a...
View ArticleVariadic Generics
Alexey_Komnin: struct Variadic<variadic T> where T.count > 0 { var value: T[0] var tail: T[1..<T.count] } The main question I am not able to solve, what is an empty variadic? Shouldn‘t...
View ArticleVariadic Generics
Let's look at the Variadic Generics at the value level section. Here I say that values of variadic type are called Variadic Values and have their unique set of API, extending that of Collection; more...
View ArticleVariadic Generics
I don't know if it has already been told, but in the Variadic Values subsection it is stated: A variadic value can never leave a generic context ⏤ it must always be transformed in something else to do...
View Article
More Pages to Explore .....