Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison to lattices #4

Closed
phadej opened this issue Jun 15, 2017 · 4 comments
Closed

Comparison to lattices #4

phadej opened this issue Jun 15, 2017 · 4 comments

Comments

@phadej
Copy link

phadej commented Jun 15, 2017

I see partial-order has some additional combinators, not present in http://hackage.haskell.org/package/lattices, but is there any other reasons to prefer one over another?

@mtesseract
Copy link
Owner

Hi,

I'm not familiar with the lattices package, but it seems to me that they are rather different. partial-order really focuses on that: defining a type class for partial orders & providing instances for several types. Since partial orders induce a notion of equality, my package also provides some convenience functions like elem or nub.

It doesn't introduce the notion of lattices.

Also, it provides instances and functions for e.g. testing for the subset-relation of lists out of the box:

Prelude> import qualified Data.PartialOrd as PO
Prelude PO> [3,1] PO.<= [1..10]
True
Prelude PO> 

Does this answer your question?

@phadej
Copy link
Author

phadej commented Jun 28, 2017

Partially,

lattices has Algebra.PartialOrd too. And there is instances for subset partial order for Set.

There isn't a partial order for lists, but if added it probably be subrange relation (i.e. isInfixOf)

@mtesseract
Copy link
Owner

Ok, as I understand it we can summarize: The packages have some overlap, but don't provide equivalent functionality. What do you think, shall we close the issue?

@andreasabel
Copy link

lattices has Algebra.PartialOrd too. And there is instances for subset partial order for Set.

Some comparison between the interfaces in lattices and partial-order is here:

(Unfortunately, neither interface fits my needs: connectedness of nodes in a DAG is a partial order, but it is relative to a context (the DAG), a nodes in a particular DAG do not make a good Haskell type.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants