typelevel / algebra

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

Code gen for tuple instances #82

Closed adelbertc closed 9 years ago

non commented 9 years ago

This looks great.

Could you add support for (at least) PartialOrder, Semilattice, EuclideanRing, and Field?

In theory we could support all the other variants (e.g. the commutative versions, Bands, bounded lattices) but I'm willing to wait and see if anyone asks for those.

johnynek commented 9 years ago

@non you steered him wrong on Field, my friend.

johnynek commented 9 years ago

Of course, it would be cool to have a Galois fields for tuples of Boolean. :) (which is the one exception that pops to mind for standard scala types, but it does not compose this way).

adelbertc commented 9 years ago

@johnynek Thanks for your feedback, will address them soon! I'm out of town for the weekend so most likely won't be able to do anything until next week.

non commented 9 years ago

:+1:

non commented 9 years ago

@johnynek I encouraged @adelbertc to add the euclidean ring instance (as well as the erroneous field instance). I'm pretty sure it's OK (although I haven't written a proof yet) but if you are nervous I would be willing to remove it (and obviously apologize to @adelbertc for suggesting the work).

johnynek commented 9 years ago

Yeah, I guess it works for a Euclidean Ring, but I noticed that we don't actually have a test for Euclidean Rings. It is currently a TODO and actually just checking the Ring laws.

+1 from me. Added #85