haskellari / lattices

Fine-grained lattice primitives for Haskell
BSD 3-Clause "New" or "Revised" License
35 stars 15 forks source link

Should PartialOrd be a superclass of joins and meets? #54

Open ocharles opened 6 years ago

ocharles commented 6 years ago

If "n mathematics, a join-semilattice (or upper semilattice) is a partially ordered set that has a join (a least upper bound)", shouldn't we have

class PartialOrd a => JoinSemiLattice a where
class PartialOrd a => MeetSemiLattice a where

?

This would have pre-empted the problems reported in https://github.com/phadej/lattices/pull/53 and https://github.com/phadej/lattices/pull/52.

phadej commented 6 years ago

That will make life hard for types without decidable equality, like JoinSemiLattice v => JoinSemiLattice (k -> v)

ocharles commented 6 years ago

Ah, that is problematic.