dao
dao copied to clipboard
Template type aliases?
We need a proper way of supporting iterators in classes. ForIterator which yields any, thus eliding any kind of static checks, seems like a crude hack now, when we have such an advanced type system. I think that any should ultimately be used only when really anything is meant.
This is a good occasion to ask for support of templates in type aliases:
type ForIterator<@T> = tuple<valid: bool, iterator: @T>
Such thing could be of use beyond this case. For instance, I'm thinking about using it for named parameters, which currently look unnecessarily complex in their 'naked' form.
I was already few times thinking about the any type (not only in the case of iterators), but I didn't come up with such elegant solution. The proposed type aliases look like a very strong tool and should be really useful.
Ping.