Advertisement
kothasuhas

Untitled

Nov 4th, 2020
2,661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. structure Election =
  2. struct
  3.  
  4. fun ballot labs mascots =
  5.   let
  6.     val labs_len = Seq.length labs
  7.     val mascots_len = Seq.length mascots
  8.   in
  9.     Seq.tabulate (fn x => (Seq.nth labs (x mod labs_len), Seq.nth mascots (x div labs_len))) (labs_len*mascots_len)
  10.   end
  11.  
  12. fun newvoters s1 s2 =
  13.   Seq.tabulate (fn x => x + Seq.length s1) (Seq.length s2 - Seq.length s1)
  14.  
  15. fun newconverts s1 s2 =
  16.   Seq.reduce (op +) 0 (Seq.map (fn (0, 1) => 1 | _ => 0) (Seq.zip (s1, s2)))
  17.  
  18. fun mode S = raise Fail "Unimplemented"
  19.  
  20. fun result S = raise Fail "Unimplemented"
  21.  
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement