Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuples with more than two elements #3

Open
rengolin opened this issue Apr 2, 2020 · 1 comment
Open

Tuples with more than two elements #3

rengolin opened this issue Apr 2, 2020 · 1 comment

Comments

@rengolin
Copy link

rengolin commented Apr 2, 2020

Tuples are restricted to two elements, not only by the operation definition of arguments (LHS, RHS) but also the accessors (first, second), like C++ std::pair. However, in most languages (including C++), tuples can have more than two arguments (and accessed via std::get() for example).

I'm wondering why the restriction, and if it's a preliminary one, perhaps making the decision now would avoid having to reexamine all the assumptions later on.

@rengolin
Copy link
Author

rengolin commented Apr 2, 2020

Given that creating the second element of the tuple is reapplying the rise.tuple operation on the first tuple + the second argument, we could chain that indefinitely and therefore get away with the restriction.

The get method would have an extra argument, the index of the element to be retrieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant