condorcet-0.0.1: Library for Condorcet voting

Condorcet

Synopsis

Documentation

type Candidate = IntSource

Candidates are represented as integers.

type Ballot = [[Candidate]]Source

Ballots are a ranking of candidates.

Ballots are lists, where each element is a list of candidates the rank the same. Earlier entries in the ballot list are ranked higher.

E.g., this ballot:

 [ [1,3], [4], [2] ]

Means that 1 and 3 are tied for first, outranking 4, and everyone beats 2.

runSource

Arguments

:: [Ballot]

A list of ballots

-> [Candidate]

The winning candidates

run runs the process, taking a list of Ballots and returning a list of winning candidates.