2

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:

  • Data.Semigroup.Max
  • Data.Semigroup.All
  • Data.Semigroup.Any
  • Data.Map.Append.AppendMap

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

  • 1
    "Big list" questions are typically considered off-topic here, because it's almost impossible to write an answer that is both complete and future-proof. I know that's not your goal, but... it *is* part of the site's stated goals, and the way it maintains the property that answers live forever is by banning questions that can't be answered in such a way. There may be other fora that welcome this question in the spirit it was intended; I encourage you to seek them out. – Daniel Wagner Dec 02 '19 at 16:11

2 Answers2

1

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.

Will Ness
  • 70,110
  • 9
  • 98
  • 181
0

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.