typelevel / algebra

Experimental project to lay out basic algebra type classes
https://typelevel.org/algebra/
Other
378 stars 69 forks source link

submit Priority to scala.util.Priority? #67

Open johnynek opened 9 years ago

johnynek commented 9 years ago

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.

non commented 9 years ago

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

johnynek commented 9 years ago

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).

non commented 9 years ago

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. :)

johnynek commented 9 years ago

sounds good.

johnynek commented 3 years ago

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.