algebra
algebra copied to clipboard
Experimental project to lay out basic algebra type classes
This came up in https://github.com/typelevel/cats-testkit-scalatest/issues/174#issuecomment-1027569935. cc @rossabaker The sources in this repository have been copied into Cats and already participated in the 2.7.0 release. The 3 open PRs were merged...
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...
This follows the Spire implementations as well (we just put `Sign` into the `Signed` companion object). We added the missing companion object functions.
This aligns the commutative rings/field hierarchy with the one available in Spire. I haven't provided instances for non-exact types such as Long, Int, etc, because their overflow behaviour doesn't work...
This merges #246 and #247, which can be reviewed separately; it also adds laws that combine both operations.
Right now, `spire` has a finer grained distinction of commutative rings, namely: - the availability of `gcd` and `lcm` operations, - the availability of Euclidean division (`emod`, `equot`), in the...
Right now, there's `AdditiveSemigroup` and `MultiplicativeSemigroup` which are then combined into `Semiring`. This is all well and good, but unfortunately there's a huge amount of code out there written on...
Over in Spire, @denisrosset is submitting a [PR to add partial algebras](https://github.com/non/spire/pull/341). (Essentially, these operations would provide `partialCombine(A, A): Option[A]` instead of the more usual `combine(A, A): A`.) The most...
(This comment is *not* about the simpler encoding discussed in #206.) I remarked that the laws structure does not follow the typeclass structure exactly. For example, we have tests for...
I think that these typeclasses should go into Algebra.