-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Data structure supporting partial orders -- -- Please see README.md @package partialord @version 0.0.0 -- | Partial orders module Data.PartialOrd -- | A data type representing relationships between two objects in a poset: -- they can be related (by EQ', LT' or GT'; like EQ, LT or GT), or -- unrelated (NT'). data PartialOrdering EQ' :: PartialOrdering LT' :: PartialOrdering GT' :: PartialOrdering NT' :: PartialOrdering -- | Convert an ordering into a partial ordering fromOrd :: Ordering -> PartialOrdering -- | Convert a partial ordering to an ordering toMaybeOrd :: PartialOrdering -> Maybe Ordering -- | Convert an ordering into a partial ordering fromMaybeOrd :: Maybe Ordering -> PartialOrdering -- | Convert from leq and geq to a partial ordering fromLeqGeq :: Bool -> Bool -> PartialOrdering -- | A typeclass expressing partially ordered types: any two elements are -- related by a PartialOrdering. class PartialOrd a compare' :: PartialOrd a => a -> a -> PartialOrdering leq :: PartialOrd a => a -> a -> Bool geq :: PartialOrd a => a -> a -> Bool -- | Are they LT', EQ', GT' comparable :: PartialOrd a => a -> a -> Bool -- | A helper type for constructing partial orderings from total orderings -- (using deriving via) newtype FullyOrd a FullyOrd :: a -> FullyOrd a [getOrd] :: FullyOrd a -> a -- | A helper type for constructing partial orderings where everything is -- equal or incomparable. newtype Discrete a Discrete :: a -> Discrete a [getDiscrete] :: Discrete a -> a -- | Sets of incomparable elements, with a monoidal structure obtained by -- taking the maximal ones. -- -- Unfortunately, we need a full ordering for these to work (since they -- use sets), though we don't assume this ordering has any compatibility -- with the partial order. The monoid structures are most efficient with -- pre-reduced sets as the left-hand argument. newtype Maxima a Maxima :: Set a -> Maxima a [maxSet] :: Maxima a -> Set a -- | Find the maxima of a list (passing it through the machinery above) maxima :: (Ord a, PartialOrd a) => [a] -> [a] -- | As above, but with minima newtype Minima a Minima :: Set a -> Minima a [minSet] :: Minima a -> Set a -- | Find the minima of a list (passing it through the machinery above) minima :: (Ord a, PartialOrd a) => [a] -> [a] -- | Lists partially ordered by infix inclusion newtype Infix a Infix :: [a] -> Infix a [unInfix] :: Infix a -> [a] -- | Lists partially ordered by prefix inclusion newtype Prefix a Prefix :: [a] -> Prefix a [unPrefix] :: Prefix a -> [a] -- | Lists partially ordered by suffix inclusion newtype Suffix a Suffix :: [a] -> Suffix a [unSuffix] :: Suffix a -> [a] -- | Lists partially ordered by the subsequence relation newtype Subseq a Subseq :: [a] -> Subseq a [unSubseq] :: Subseq a -> [a] instance GHC.Show.Show Data.PartialOrd.PartialOrdering instance GHC.Classes.Eq Data.PartialOrd.PartialOrdering instance GHC.Show.Show a => GHC.Show.Show (Data.PartialOrd.FullyOrd a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.PartialOrd.FullyOrd a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.PartialOrd.FullyOrd a) instance GHC.Show.Show a => GHC.Show.Show (Data.PartialOrd.Discrete a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.PartialOrd.Discrete a) instance GHC.Show.Show a => GHC.Show.Show (Data.PartialOrd.Infix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.PartialOrd.Infix a) instance GHC.Show.Show a => GHC.Show.Show (Data.PartialOrd.Prefix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.PartialOrd.Prefix a) instance GHC.Show.Show a => GHC.Show.Show (Data.PartialOrd.Suffix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.PartialOrd.Suffix a) instance GHC.Show.Show a => GHC.Show.Show (Data.PartialOrd.Subseq a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.PartialOrd.Subseq a) instance Data.PartialOrd.PartialOrd GHC.Types.Int instance Data.PartialOrd.PartialOrd GHC.Num.Integer.Integer instance (GHC.Classes.Ord a, Data.PartialOrd.PartialOrd a) => GHC.Base.Semigroup (Data.PartialOrd.Minima a) instance (GHC.Classes.Ord a, Data.PartialOrd.PartialOrd a) => GHC.Base.Monoid (Data.PartialOrd.Minima a) instance (GHC.Classes.Ord a, Data.PartialOrd.PartialOrd a) => GHC.Base.Semigroup (Data.PartialOrd.Maxima a) instance (GHC.Classes.Ord a, Data.PartialOrd.PartialOrd a) => GHC.Base.Monoid (Data.PartialOrd.Maxima a) instance GHC.Classes.Eq a => Data.PartialOrd.PartialOrd (Data.PartialOrd.Subseq a) instance GHC.Classes.Eq a => Data.PartialOrd.PartialOrd (Data.PartialOrd.Suffix a) instance GHC.Classes.Eq a => Data.PartialOrd.PartialOrd (Data.PartialOrd.Prefix a) instance GHC.Classes.Eq a => Data.PartialOrd.PartialOrd (Data.PartialOrd.Infix a) instance GHC.Classes.Ord a => Data.PartialOrd.PartialOrd (Data.PartialOrd.FullyOrd a) instance GHC.Classes.Eq a => Data.PartialOrd.PartialOrd (Data.PartialOrd.Discrete a) instance Data.PartialOrd.PartialOrd () instance (Data.PartialOrd.PartialOrd a, Data.PartialOrd.PartialOrd b) => Data.PartialOrd.PartialOrd (a, b) instance (Data.PartialOrd.PartialOrd a, Data.PartialOrd.PartialOrd b, Data.PartialOrd.PartialOrd c) => Data.PartialOrd.PartialOrd (a, b, c) instance (Data.PartialOrd.PartialOrd a, Data.PartialOrd.PartialOrd b, Data.PartialOrd.PartialOrd c, Data.PartialOrd.PartialOrd d) => Data.PartialOrd.PartialOrd (a, b, c, d) instance (Data.PartialOrd.PartialOrd a, Data.PartialOrd.PartialOrd b, Data.PartialOrd.PartialOrd c, Data.PartialOrd.PartialOrd d, Data.PartialOrd.PartialOrd e) => Data.PartialOrd.PartialOrd (a, b, c, d, e) instance GHC.Classes.Ord a => Data.PartialOrd.PartialOrd (Data.Set.Internal.Set a) instance Data.PartialOrd.PartialOrd Data.IntSet.Internal.IntSet instance GHC.Base.Semigroup Data.PartialOrd.PartialOrdering instance GHC.Base.Monoid Data.PartialOrd.PartialOrdering