This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Should we remove the construction methods in algebra.lattice? #108
Comments
Note that the return type of |
Yeah. |
I would be fine removing these things. It may be the case that we will want to use something more like |
Given all the confusion around these methods (what to call them, what their return types should be, whether they will be refined in subtypes, etc.) I think we should just remove them and handle this via a different mechanism. |
Yeah, it makes more and more sense to me 👍 |
armanbilge
added a commit
to armanbilge/cats
that referenced
this issue
Jun 5, 2021
18 tasks
pikinier20
pushed a commit
to pikinier20/cats
that referenced
this issue
Oct 25, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the lattices, we have a number of methods to create ring structures from lattices. These seem like particular constructions to me, and perhaps not best bolted onto the traits themselves.
For instance, we could add:
which is a construction to create a Monoid from a semigroup using
None
as the unit, but I wouldn't want to do that. Similarly we can build aRing[(BigInt, T)]
from aRng[T]
by adding a1
element and counting how many times it has been added(a: BigInt, t: T) = a * 1 + t
, but again, that construction I would rather have a named class for that than bolt it onto the trait.By contrast,
.meetSemilattice
is not a construction, it is exactly taking themeet
and returning aSemilattice
instance whichcombine == meet
. This feels different to me.Somewhat similarly is the
.dual
. Maybe we should havecase class DualLattice[T](lattice: Lattice[A]) extends Lattice[A]
or some such, instead of methods on the traits.The text was updated successfully, but these errors were encountered: