Skip to content

Stacked instance of Lattice, conversion functions from Either and Maybe#99

Closed
erykciepiela wants to merge 3 commits intohaskellari:masterfrom
erykciepiela:stacked_nothingOnTopOfJust_justOnTopOfNothing
Closed

Stacked instance of Lattice, conversion functions from Either and Maybe#99
erykciepiela wants to merge 3 commits intohaskellari:masterfrom
erykciepiela:stacked_nothingOnTopOfJust_justOnTopOfNothing

Conversation

@erykciepiela
Copy link
Copy Markdown
Contributor

Introduce Stacked data type isomorphic to Either.
Add (Lattice a, Lattice b) => Lattice (Stacked a b) instance constructed by considering all minimal elements of b covering all maximal elements of a.
Add conversion functions from Either to Stacked.
Add conversion functions from Maybe to Dropped and Lifted.

Motivation for conversion functions is to allow for easy integration with ecosystem that pervasively uses Either and Maybe.

Disclaimer: I didn't manage to include QC.CoArbitrary and QC.Function instances of Stacked, need help in that.

I'm open to idea/naming/code style suggestions.

Copy link
Copy Markdown
Collaborator

@phadej phadej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, few comments inline.

@erykciepiela
Copy link
Copy Markdown
Contributor Author

Remarks applied. Please re-review.

@phadej phadej mentioned this pull request Feb 18, 2020
@phadej
Copy link
Copy Markdown
Collaborator

phadej commented Feb 18, 2020

I made few extra additions in #100 and published https://hackage.haskell.org/package/lattices-2.0.2

Thanks you!

@phadej phadej closed this Feb 18, 2020
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

Successfully merging this pull request may close these issues.

2 participants