typelevel / algebra

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

Added fromAll to Eq,Order,PartialOrder (#69) #70

Closed FrankRaiser closed 8 years ago

non commented 9 years ago

Thanks, this looks good!

@johnynek would you prefer to let this PR sit awhile and while we look into a macro solution? Or should we merge this and then replace it with a macro?

johnynek commented 9 years ago

I'm happy to merge this after some comments. It could be useful in cases the macros could not easily cover (traits, non-case-classes).

johnynek commented 9 years ago

style note: inconsistent spacing with :. Prefer (a: A): B style to (a : A) : B

johnynek commented 9 years ago

@non what do you think about @sp on these methods? I think we don't need it and it will cause us some jar bloat. These methods don't really make sense on primitives.

non commented 9 years ago

Yes, I agree. These generic type parameters should not be specialized.

johnynek commented 9 years ago

@non and you prefer fromAll even in the lexicographic ordering?

non commented 9 years ago

I'm not sure. Mostly I wanted a name to relate it to from but to make it clear it uses several functions.

johnynek commented 9 years ago

@non I like the from part, it is just that the all part does not sound lexicographic to me. fromLazily?

non commented 9 years ago

Sure, fromLazily seems good to me.

johnynek commented 9 years ago

@FrankRaiser I think we got consensus on fromLazily for the Order case, if you think that sounds okay too.

FrankRaiser commented 9 years ago

Sounds fine with me. I'm a bit short on time now, but should get an updated PR ready this weekend.

johnynek commented 9 years ago

Cool. Thanks for the help!

johnynek commented 9 years ago

Looks good to me. If we can make this merge cleanly, I'll click the shiny green button.

johnynek commented 8 years ago

@FrankRaiser will you be able to get a clean merge here? It would be great to merge any binary incompatible change as soon as possible (this would be one).

johnynek commented 8 years ago

@non about my previous comment: maybe these constructor functions should go into a package like std? They are not changing the shape of the traits, but I think (could be wrong) that they will change the binary (adding methods to traits causes issues, maybe not to objects).

johnynek commented 8 years ago

we moved Eq Order etc.. to cats-kernel in typelevel/cats.