There was some discussion of this recently here: What's the best way to dispatch on an _iterable_ trait?.
The TLDR is: yes, you can do this (and you can do it efficiently), but there’s probably a better way to get what you want.
There was some discussion of this recently here: What's the best way to dispatch on an _iterable_ trait?.
The TLDR is: yes, you can do this (and you can do it efficiently), but there’s probably a better way to get what you want.