You're right; I forgot to account for subclassing.
If I switched off of pattern matching to pull out the closures and instead used Kernel.elem, it would work with tuples of varying length. Then you'd be able to write subclasses by replacing the closures with your own, and add additional items to the end to add more methods.
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.