hjugement-2.0.2.20190414: Majority Judgment.

Majority.Merit

Synopsis

# Type Choices

choices :: (Bounded choice, Enum choice, Eq choice, Hashable choice) => Choices choice Source #

Return a set of Choices by enumerating the alternatives of its type. Useful on sum types.

# Type Grades

type Grades = Set Source #

How many grades should be used? A greater number of grades permits a finer distinction but demands a higher degree of expertise and discernment. The optimal number is the highest number of grades that constitutes a common language, that is, that allows Judges to make absolute judgments. Too little grades may lead too often to ties.

Note, however, that if the inputs or grades depend on the set of choices, i.e. if judges change their grades when choices are added or dropped, then the Arrow paradox cannot be avoided. To avoid this the scale of grades must be fixed and absolute so that more or fewer choices does not change the inputs or messages of other choices.

# Type Ranked

newtype Ranked a Source #

Helper type to rank data without a good Ord instance.

Constructors

 Ranked (G, a)
Instances
 Source # Instance detailsDefined in Majority.Merit Methodsfmap :: (a -> b) -> Ranked a -> Ranked b #(<\$) :: a -> Ranked b -> Ranked a # Eq (Ranked a) Source # Instance detailsDefined in Majority.Merit Methods(==) :: Ranked a -> Ranked a -> Bool #(/=) :: Ranked a -> Ranked a -> Bool # Ord (Ranked a) Source # Instance detailsDefined in Majority.Merit Methodscompare :: Ranked a -> Ranked a -> Ordering #(<) :: Ranked a -> Ranked a -> Bool #(<=) :: Ranked a -> Ranked a -> Bool #(>) :: Ranked a -> Ranked a -> Bool #(>=) :: Ranked a -> Ranked a -> Bool #max :: Ranked a -> Ranked a -> Ranked a #min :: Ranked a -> Ranked a -> Ranked a # Show a => Show (Ranked a) Source # Instance detailsDefined in Majority.Merit MethodsshowsPrec :: Int -> Ranked a -> ShowS #show :: Ranked a -> String #showList :: [Ranked a] -> ShowS #

zipRank :: [a] -> [Ranked a] Source #

zipRank xs returns a list with the items of xs wrapped so that they are compareable according to their position into xs.

rankKey :: [(k, a)] -> [(Ranked k, a)] Source #

## Type G

type G = Integer Source #

rank :: Ranked a -> G Source #

unRank :: Ranked a -> a Source #

enum :: (Bounded a, Enum a, Ord a) => Set a Source #

Return the Set enumerating the alternatives of its type parameter. Useful on sum types.

# Type Judges

type Judges = HashMap Source #

Map each judge to its default grade (usually the same for all judges but not necessarily).

For instance, when a judge gives no grade or has “no opinion”, this default grade could mean that the judge chooses “To Reject” the choice: the rationale being that a judge having “no opinion” concerning a choice has not even taken the time to evaluate it and thus has implicitly rejected it.

judges :: Eq judge => Hashable judge => [judge] -> grade -> Judges judge grade Source #

# Type Opinions

Profile of opinions of some judges about a single choice.

opinions :: Eq judge => Hashable judge => Judges judge grade -> Opinions judge grade -> (Opinions judge grade, HashSet judge) Source #

(ok, ko) = opinions js os returns:

• in ok the opinions of the judges js updated by those in os,
• in ko the opinions of judges not in js.

## Type Distribution

Usually, a judge gives a singleGrade to a given choice. However, when applying the Majority Judgment to a Tree of Sections, what a judge gives to a parent Section is composed by the grades he or she has given to the sub-Sections, and those can be different. In that case, each grade given to a sub-Section contributes to a Share of the parent Section which therefore is not necessarily a singleGrade, but more generally a Distribution of grades. And the sub-Sections can actually themselves have sub-Sections, hence not being given a grade, but a Distribution of grades too.

### Type Share

type Share = Rational Source #

Usually a judge attributes a singleGrade to a given choice, and then the Share of this grade is 1. However, when introducing vote colleges (giving more power to some judges), or when introducing Sections (decomposing a judgment into several sub-judgments), it becomes possible that only a percentage of grade is attributed by a judge to a given choice. This is what a Share is used for.

## Type OpinionsByChoice

type OpinionsByChoice choice judge grade = HashMap choice (Opinions judge grade) Source #

Profile of opinions of some Judges about some choices.

opinionsByChoice :: Eq choice => Hashable choice => [(choice, Opinions judge grade)] -> OpinionsByChoice choice judge grade Source #

# Type Merit

Profile of merit about a single choice.

Constructors

 Merit FieldsunMerit :: Map grade Share
Instances

merit os returns the Merit given by opinions os

meritFromList :: Ord grade => Foldable opinions => Functor opinions => opinions grade -> Merit grade Source #

'normalizeMerit m' multiply all Shares by their least common denominator to get integral Shares.

## Type MeritByChoice

newtype MeritByChoice choice grade Source #

Profile of merit about some choices.

Constructors

 MeritByChoice FieldsunMeritByChoice :: HashMap choice (Merit grade)
Instances
meritByChoice gs cs os returns the Merits given to choices cs by opinions os from the Judges js on the Grades gs.