So you define your filter function by saying it can use anything that has the next and the len functions. Cool.
If a type A defined in module_a doesn’t have the functions defined in its module, should it still be filterable?
If the required function is defined in a module_b should A be filterable?
When calling a function, compiler would check separately for existence of each function defined in the trait. That is a trait would be just like any other type alias so that you do not need to repeating complex function names everywhere:
You could write:
but that would be just syntactic sugar for this: Basically removing traits alltogether, just relying on functions.