Here are three SIP proposals that I came across while doing a deep dive on Scala over the past few weeks (I am looking for remote work as my company Adligo contact email@example.com if your interested )
I have given the proposals the temporary ids for sake of discussion;
Adligo .SIP?. A , Adligo .SIP?. B , Adligo .SIP?. C
Adligo .SIP?. A ) This is a simple idea to combine the ‘map’ and 'filter ’ methods into a single method ‘convert’ in order to reduce the number of traversals from two to one in certain scenarios as follows;
map[A] takes ( A => B) and returns either a Iterator[B] or collection[B]
filter[B] takes ( A => Boolean) and returns either a Iterator[A] or collection[A]
I am suggesting an additional method;
convert[B] takes (A => (Boolean, B)) and returns either a Iterator[B] or collection[B]
Note the function passed to convert returns a boolean (to filter or not) in the left tuple slot, and the converted/mapped value in the right tuple slot.
There is a discussion on the topic here, with some solutions that I feel could be greatly improved on with a convert implementation;
I have created a rough proof of concept here;
I think there are a large number of places where this ‘convert’ idea could be used i.e.;
I think this will reduce the time complexity of the programs by roughly O(n/2) in many cases for large collections!
Adligo .SIP?. B ) l would like Java convenience methods ’ containsAll ', ’ removeAll ', ’ retainAll ’ added to the Scala collections and additional convenience methods for Maps ‘containsAllKeys’, ‘removeAllKeys’, ‘retainAllKeys’. This also has a external discussion going;
Adligo .SIP?. C ) Scala has a cool method 'combinations( tupleSize : Int)’ , I would like a method ‘combinations()’ added that calculates all the combinations. This is mostly for programming competitions
That’s it, again I’m looking for remote work ( firstname.lastname@example.org ). If I find work I can dedicate some time to implementing much of this, if others also think it’s a good idea. I don’t see it changing that much for Scala3, but I also don’t know much at all about Scala3 :)_