algebra icon indicating copy to clipboard operation
algebra copied to clipboard

submit Priority to scala.util.Priority?

Open johnynek opened this issue 10 years ago • 5 comments

I copied https://github.com/non/algebra/blob/master/core/src/main/scala/algebra/Priority.scala into algebird because I wanted to resolve an issue with algebird + spark and spark's approach of using implicit ord: Ordering[K] = null with the fact that you can't in 2.11 have overloaded methods and default parameters (so I used Priority[Ordering[K], DummyImplicit] and .getPreferred.orNull).

It occurs to me, this could be a candidate to add to scala. It is unlikely to change much.

If they'd never accept it, no big deal, but it seems to be one of the easier things to move there.

johnynek avatar Jul 07 '15 19:07 johnynek

Sure, let's give it a shot! Do you want to submit it or shall I?

non avatar Jul 07 '15 19:07 non

Either way. If you want to, you are more than welcome, but similarly, I don't want to task you. I'm willing to as well (of course as is often the case, I might be slow to get to it).

johnynek avatar Jul 07 '15 20:07 johnynek

Why don't you do it? If you decide you don't have time comment here and then I'll do it if/when I get to it. :)

non avatar Jul 07 '15 20:07 non

sounds good.

johnynek avatar Jul 08 '15 17:07 johnynek

I guess this fell off my radar. :(

I think the better approach might be to actually just use Either in the standard library, especially since right biased map has been standardized.

johnynek avatar Jun 30 '21 20:06 johnynek