pareto-front-0.1.0.1: Monoids for dealing with Pareto efficiency
Safe HaskellNone
LanguageHaskell2010

Math.ParetoFront

Synopsis

Documentation

data Comparison Source #

The outcome of comparing two items by possibly multiple contradicting criteria.

Constructors

Dominated

Where the second item is preferred by all used criteria

WeakTie

Where no item is preferred by any used criterion

StrongTie

Where each item is preferred by at least one criterion

Dominates

Where the first item is preferred by all used critera

class Debatable a where Source #

Items which can be compared by possibly multiple criteria contradicting criteria

Methods

weigh :: a -> a -> Comparison Source #

Instances

Instances details
Debatable Double Source # 
Instance details

Defined in Math.ParetoFront

Debatable Float Source # 
Instance details

Defined in Math.ParetoFront

Debatable Int Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: Int -> Int -> Comparison Source #

Debatable Integer Source # 
Instance details

Defined in Math.ParetoFront

Ord a => Debatable (Min a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: Min a -> Min a -> Comparison Source #

Ord a => Debatable (Max a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: Max a -> Max a -> Comparison Source #

Debatable a => Debatable (Down a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: Down a -> Down a -> Comparison Source #

(Debatable a, Debatable b) => Debatable (a, b) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: (a, b) -> (a, b) -> Comparison Source #

Debatable a => Debatable (Arg a b) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: Arg a b -> Arg a b -> Comparison Source #

(Debatable a, Debatable b, Debatable c) => Debatable (a, b, c) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: (a, b, c) -> (a, b, c) -> Comparison Source #

(Debatable a, Debatable b, Debatable c, Debatable d) => Debatable (a, b, c, d) Source # 
Instance details

Defined in Math.ParetoFront

Methods

weigh :: (a, b, c, d) -> (a, b, c, d) -> Comparison Source #

data Front a Source #

A collection of items where no item is preferred by all criteria.

Instances

Instances details
Foldable Front Source # 
Instance details

Defined in Math.ParetoFront

Methods

fold :: Monoid m => Front m -> m #

foldMap :: Monoid m => (a -> m) -> Front a -> m #

foldMap' :: Monoid m => (a -> m) -> Front a -> m #

foldr :: (a -> b -> b) -> b -> Front a -> b #

foldr' :: (a -> b -> b) -> b -> Front a -> b #

foldl :: (b -> a -> b) -> b -> Front a -> b #

foldl' :: (b -> a -> b) -> b -> Front a -> b #

foldr1 :: (a -> a -> a) -> Front a -> a #

foldl1 :: (a -> a -> a) -> Front a -> a #

toList :: Front a -> [a] #

null :: Front a -> Bool #

length :: Front a -> Int #

elem :: Eq a => a -> Front a -> Bool #

maximum :: Ord a => Front a -> a #

minimum :: Ord a => Front a -> a #

sum :: Num a => Front a -> a #

product :: Num a => Front a -> a #

Show a => Show (Front a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

showsPrec :: Int -> Front a -> ShowS #

show :: Front a -> String #

showList :: [Front a] -> ShowS #

Debatable a => Semigroup (Front a) Source #

Where two Fronts are combined, all items are retained except those for which at least one other item is preferred by all criteria.

Instance details

Defined in Math.ParetoFront

Methods

(<>) :: Front a -> Front a -> Front a #

sconcat :: NonEmpty (Front a) -> Front a #

stimes :: Integral b => b -> Front a -> Front a #

Debatable a => Monoid (Front a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

mempty :: Front a #

mappend :: Front a -> Front a -> Front a #

mconcat :: [Front a] -> Front a #

data Strata a Source #

A series of Fronts such that each subsequent Front consists of items for which some item in the previous front is preferable by all criteria.

Instances

Instances details
Foldable Strata Source # 
Instance details

Defined in Math.ParetoFront

Methods

fold :: Monoid m => Strata m -> m #

foldMap :: Monoid m => (a -> m) -> Strata a -> m #

foldMap' :: Monoid m => (a -> m) -> Strata a -> m #

foldr :: (a -> b -> b) -> b -> Strata a -> b #

foldr' :: (a -> b -> b) -> b -> Strata a -> b #

foldl :: (b -> a -> b) -> b -> Strata a -> b #

foldl' :: (b -> a -> b) -> b -> Strata a -> b #

foldr1 :: (a -> a -> a) -> Strata a -> a #

foldl1 :: (a -> a -> a) -> Strata a -> a #

toList :: Strata a -> [a] #

null :: Strata a -> Bool #

length :: Strata a -> Int #

elem :: Eq a => a -> Strata a -> Bool #

maximum :: Ord a => Strata a -> a #

minimum :: Ord a => Strata a -> a #

sum :: Num a => Strata a -> a #

product :: Num a => Strata a -> a #

Show a => Show (Strata a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

showsPrec :: Int -> Strata a -> ShowS #

show :: Strata a -> String #

showList :: [Strata a] -> ShowS #

Debatable a => Semigroup (Strata a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

(<>) :: Strata a -> Strata a -> Strata a #

sconcat :: NonEmpty (Strata a) -> Strata a #

stimes :: Integral b => b -> Strata a -> Strata a #

Debatable a => Monoid (Strata a) Source # 
Instance details

Defined in Math.ParetoFront

Methods

mempty :: Strata a #

mappend :: Strata a -> Strata a -> Strata a #

mconcat :: [Strata a] -> Strata a #

getFront :: Front a -> [a] Source #

quota :: Int -> Strata a -> Strata a Source #

Drop fronts after those accounting for the first n items.

nestedFold :: (Monoid m, Monoid n) => (a -> m) -> (m -> n) -> Strata a -> n Source #

foldMap each front separately with one function, then foldMap the results.