lattices 2 → 2.0.1
raw patch · 3 files changed
+20/−4 lines, 3 filesdep ~basedep ~base-compatPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, base-compat
API changes (from Hackage documentation)
+ Algebra.PartialOrd: instance (Algebra.PartialOrd.PartialOrd a, Algebra.PartialOrd.PartialOrd b) => Algebra.PartialOrd.PartialOrd (Data.Either.Either a b)
Files
- CHANGELOG.md +4/−0
- lattices.cabal +4/−4
- src/Algebra/PartialOrd.hs +12/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 2.0.1 (2019-07-22)++- Add `(PartialOrd a, PartialOrd b) => PartialOrd (Either a b)` instance+ # 2 (2019-04-17) - Reduce to three classes (from six): `Lattice`, `BoundedMeetSemiLattice`
lattices.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: lattices-version: 2+version: 2.0.1 category: Math license: BSD3 license-file: LICENSE@@ -75,7 +75,7 @@ , base-compat >=0.10.5 && <0.11 , containers >=0.5.0.0 && <0.7 , deepseq >=1.3.0.0 && <1.5- , hashable >=1.2.7.0 && <1.3+ , hashable >=1.2.7.0 && <1.4 , integer-logarithms >=1.0.3 && <1.1 , QuickCheck >=2.12.6.1 && <2.14 , semigroupoids >=5.3.2 && <5.4@@ -86,7 +86,7 @@ , unordered-containers >=0.2.8.0 && <0.3 if !impl(ghc >=8.0)- build-depends: semigroups >=0.18.5 && <0.19+ build-depends: semigroups >=0.18.5 && <0.20 if !impl(ghc >=7.10) build-depends: void >=0.7.2 && <0.8@@ -115,4 +115,4 @@ , unordered-containers if !impl(ghc >=8.0)- build-depends: semigroups >=0.18.3 && <0.19+ build-depends: semigroups
src/Algebra/PartialOrd.hs view
@@ -148,6 +148,18 @@ -- ordering is incompatible with the transitivity axiom we require for the derived partial order (x1, y1) `leq` (x2, y2) = x1 `leq` x2 && y1 `leq` y2 + comparable (x1, y1) (x2, y2) = comparable x1 x2 && comparable y1 y2++-- | @since 2.0.1+instance (PartialOrd a, PartialOrd b) => PartialOrd (Either a b) where+ Left x `leq` Left y = leq x y+ Right x `leq` Right y = leq x y+ leq _ _ = False++ comparable (Left x) (Left y) = comparable x y+ comparable (Right x) (Right y) = comparable x y+ comparable _ _ = False+ -- | Least point of a partially ordered monotone function. Checks that the function is monotone. lfpFrom :: PartialOrd a => a -> (a -> a) -> a lfpFrom = lfpFrom' leq