diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-01-06 00:11:00 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-01-06 00:11:00 +1100 |
commit | ed35d03fbdafce4d6d41d8731318304a8eb7ff61 (patch) | |
tree | 42a8fa732ae779a71db2561c93f63979cc4a5fe6 /src/SenateTypes.hs | |
parent | a13d9db820d7cb83e9472e2cf387eb22c26d402d (diff) |
Ballot counting working, but results differ slightly from AEC counts
Diffstat (limited to 'src/SenateTypes.hs')
-rw-r--r-- | src/SenateTypes.hs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/SenateTypes.hs b/src/SenateTypes.hs new file mode 100644 index 0000000..764e733 --- /dev/null +++ b/src/SenateTypes.hs @@ -0,0 +1,42 @@ +module SenateTypes( + Ranking, + Position, + CandidateID, + AbovePreferences, + BelowPreferences, + FullPreferences, + UpperMap, + LowerMap, + Trace + ) where + + + +-- fairly obvious, rankings, positions and candidateIDs are all numbers +type Ranking = Int +type Position = Int +type CandidateID = String + + + +type AbovePreferences = [(Position,Ranking)] +type BelowPreferences = [(Position,Ranking)] +type FullPreferences = (AbovePreferences,BelowPreferences) + + + +-- positions in the uppermap list correspond to the boxes above the line, +-- and the lists of candidateIDs are the boxes below the line +type UpperMap = [[Position]] + + + +-- a list of candidates in the order of how they were placed below the line +type LowerMap = [CandidateID] + + + +-- represents a criteria used for finding ballots that voted a specific +-- way, for example voted for candidate C as #1, candidate F as #2, etc +type Trace = [(Ranking,CandidateID)] + |