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

[Feature Request] Add a datastructure for Tuple #127

Open
puneetar opened this Issue Apr 17, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@puneetar

puneetar commented Apr 17, 2018

#It would be great to have a data structure for Tuple

Tuple <A, B>{
  _1 : A
  _2 : B
}

// functions
function fold()
function bimap()
@ErunamoJAZZ

This comment has been minimized.

Show comment
Hide comment
@ErunamoJAZZ

ErunamoJAZZ Apr 27, 2018

Why do you think this?

I feel a tuple type innecesary in JavaScript because arrays can do the work.
Tuples are interesing in typed languages where you cant mix types in arrays without lost their types, but this does not happen in js.

ErunamoJAZZ commented Apr 27, 2018

Why do you think this?

I feel a tuple type innecesary in JavaScript because arrays can do the work.
Tuples are interesing in typed languages where you cant mix types in arrays without lost their types, but this does not happen in js.

@puneetar

This comment has been minimized.

Show comment
Hide comment
@puneetar

puneetar Apr 28, 2018

puneetar commented Apr 28, 2018

@ErunamoJAZZ

This comment has been minimized.

Show comment
Hide comment
@ErunamoJAZZ

ErunamoJAZZ Apr 28, 2018

But in the way you suggested this, _1 and _2 have the same type, maybe you are thinking in some like Tuple<A, B> instead?

I am not using flow or ts right now, so I really don't see why this could be interesting :/

ErunamoJAZZ commented Apr 28, 2018

But in the way you suggested this, _1 and _2 have the same type, maybe you are thinking in some like Tuple<A, B> instead?

I am not using flow or ts right now, so I really don't see why this could be interesting :/

@puneetar

This comment has been minimized.

Show comment
Hide comment
@puneetar

puneetar Apr 28, 2018

🤦 corrected it.

True, it may not be interesting right now, but it is helpful when you want to return 2 types and creating a class with 2 objects is an overkill.

Take a look at https://github.com/fantasyland/fantasy-tuples, it is perfect but just don't have typescript or flow types. Therefore, though it would be perfect for funfix : Functional Programming Library for JavaScript, TypeScript and Flow

puneetar commented Apr 28, 2018

🤦 corrected it.

True, it may not be interesting right now, but it is helpful when you want to return 2 types and creating a class with 2 objects is an overkill.

Take a look at https://github.com/fantasyland/fantasy-tuples, it is perfect but just don't have typescript or flow types. Therefore, though it would be perfect for funfix : Functional Programming Library for JavaScript, TypeScript and Flow

@puneetar

This comment has been minimized.

Show comment
Hide comment
@puneetar

puneetar Jul 26, 2018

Will the authors be willing to include tuples if I work on it and create a PR ?

puneetar commented Jul 26, 2018

Will the authors be willing to include tuples if I work on it and create a PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment