Split TupledFunction into "read" and "write" type classes #17642
neko-kai
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently TupledFunction is limited as a solution for abstraction over fucntion arity - it can only abstract over arity of vanilla function types, it cannot turn inheritors of Function*, singleton function objects or refined function types into functions of tuples. It's also forcefully invariant and unwieldy when variance is involved.
Both of these can be solved by splitting
TupledFunction
into two type classes, one for converting into tupled function and one for converting from a tupled function. That way the "read" type class instance can still be synthesized for types that can never be created from a tupled function - such as singleton function objects. Both read and write type classes can also be made variant.Beta Was this translation helpful? Give feedback.
All reactions