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

Basic Tuple Operations #1074

Closed
cyberixae opened this issue Jan 4, 2020 · 3 comments
Closed

Basic Tuple Operations #1074

cyberixae opened this issue Jan 4, 2020 · 3 comments

Comments

@cyberixae
Copy link
Contributor

cyberixae commented Jan 4, 2020

🚀 Feature request

It would be nice to have some basic operations for tuples.Namely prepend, append, concat and reverse.

Suggested Solution

I ended up writing my own implementation for some of them with types from package typescript-tuple. For some reason the package provides types without implementation. See ksxnodemodules/typescript-tuple#18

@cyberixae
Copy link
Contributor Author

The said Tuple type library has some problems with latest TypeScript version ksxnodemodules/typescript-tuple#8

@gcanti
Copy link
Owner

gcanti commented Jan 11, 2020

@cyberixae this kind of operations on tuples seems pretty rare.

Anyway I would stay away from such a risky type-level programming in TypeScript.

@gcanti gcanti closed this as completed Jan 11, 2020
@cyberixae
Copy link
Contributor Author

For the record I think Tuple operations are mostly useful for currying and uncurrying functions. It doesn't matter so much when using functions that are curried out of the box but is still relevant for compatibility with uncurried functions. Whether or not such compatibility should or should not be implemented in fp-ts is another thing entirely. Perhaps we'll eventually get native support in TypeScript. See microsoft/TypeScript#33783

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

No branches or pull requests

2 participants