Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- structure Election =
- struct
- fun ballot labs mascots =
- let
- val labs_len = Seq.length labs
- val mascots_len = Seq.length mascots
- in
- Seq.tabulate (fn x => (Seq.nth labs (x mod labs_len), Seq.nth mascots (x div labs_len))) (labs_len*mascots_len)
- end
- fun newvoters s1 s2 =
- Seq.tabulate (fn x => x + Seq.length s1) (Seq.length s2 - Seq.length s1)
- fun newconverts s1 s2 =
- Seq.reduce (op +) 0 (Seq.map (fn (0, 1) => 1 | _ => 0) (Seq.zip (s1, s2)))
- fun mode S = raise Fail "Unimplemented"
- fun result S = raise Fail "Unimplemented"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement