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

Should this package be deprecated/unlisted? #45

Closed
JaffaKetchup opened this issue May 12, 2023 · 2 comments
Closed

Should this package be deprecated/unlisted? #45

JaffaKetchup opened this issue May 12, 2023 · 2 comments

Comments

@JaffaKetchup
Copy link

With the release of Dart 3.0 comes records. This pretty much does the same as this package, but has more advantages as it is more closely tied in with the other features of the language.

Is this package necessary anymore?

@oprypin
Copy link
Member

oprypin commented May 12, 2023

While we are here-
In the world of records, is there an actual convenient alternative to withItemN methods?
E.g.

tuple.dart/lib/tuple.dart

Lines 154 to 156 in aac8fae

/// Returns a tuple with the second item set to the specified value.
Tuple4<T1, T2, T3, T4> withItem2(T2 v) =>
Tuple4<T1, T2, T3, T4>(item1, v, item3, item4);

Or is there any way to write equivalent utility functions for records?

@JaffaKetchup
Copy link
Author

Hey, it's the nightly.link guy :D

Turns out, you are quite right. Records are immutable, and there's no built in way to copy them or iterate through their elements - you'd need something like (original.$1, 'new', original.$2). Can't even use the spread operator.
I hadn't used them myself yet, but would've assumed they'd have a few more functions than they do.

Maybe that in itself is enough reason for Tuples to keep existing.

@JaffaKetchup JaffaKetchup closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2023
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

2 participants