Eryk Ciepiela
Eryk Ciepiela

Reputation: 195

Join semilattice examples amongst semigroup instances in Haskell

I am collecting examples of join semilattices amongst Semigroup instances. As you may know join semilattice is similar to semigroup but requires additionally commutativity and idempotence. From the quick scan of the libraries on hackage I found the following examples:

I'm curious whether you came across any other (interesting and useful) join semilattices examples in Haskell libraries?

Upvotes: 2

Views: 178

Answers (2)

Will Ness
Will Ness

Reputation: 71065

Ordered strictly increasing lists of wholly compared elements (where equality implies sameness) seem to form join semilattice under Data.List.Ordered.union from data-ordlist package.

Upvotes: 1

Data.IntSet.IntSet has the set union operation as its <>, which seems to meet your criteria. This may be true for other sets too, as long as you're okay with pathological Eq instances for their elements breaking it.

This is also true for Proxy, but that's about as far from useful as you can get.

Upvotes: 0

Related Questions