marcglasberg / fast_immutable_collections

Dart Package: Immutable lists, sets, maps, and multimaps, which are as fast as their native mutable counterparts. Extension methods and comparators for native Dart collections.
BSD 2-Clause "Simplified" License
218 stars 30 forks source link

Can Tuple2 be removed with Dart 3.0 now having Records? #59

Closed saibotma closed 10 months ago

marcglasberg commented 1 year ago

Wouldn't that be a breaking change for everyone using Tuple2, and not much to gain from it?

saibotma commented 1 year ago

Yeah it would be a breaking change in any case. I'm anticipating that people are going to migrate from Tuple2 to Records anyways. The main gain would be that for example IList.splitAt would then return a record and the caller could then benefit from the new record syntax, which brings destructuring into local variables etc.

Another reason agains having Tuple2 in general is, that there is no Tuple3 or Tuple4. Prior to Dart 3.0 we had to add https://pub.dev/packages/tuple to our projects which also provides a Tuple2 and would thus cause a name conflict. From my point of view we should either have support for the whole tuple "spectrum" or remove it completely, because otherwise the user will use a different tuple implementation anyways.

marcglasberg commented 1 year ago

Makes sense not to return Tuple2 anymore.

saibotma commented 1 year ago

Should I create a PR for this then?

Solido commented 1 year ago

Dart 3 is nearly mandatory, having a breaking change in revision would be enough and migration does not seems too difficult. It also open the doors to more syntax sugars and new methods. Please send a PR.