DEV Community

[Comment from a deleted post]
Collapse
 
notriddle profile image
Michael "notriddle" Howell

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.