From 9c88780375c5fd42f305746156484257c02245c7 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Fri, 6 Jan 2017 18:54:42 +1100 Subject: Code reworked, now 16x faster, but uses 18.5x more memory --- src/main.hs | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/main.hs') diff --git a/src/main.hs b/src/main.hs index 99a6681..6e95f2a 100644 --- a/src/main.hs +++ b/src/main.hs @@ -37,14 +37,37 @@ below = [ "Pile, Jan" , "Strettles, Greg" ] +above2 = [[1,2],[3,4],[5,6],[7,8],[9,10],[11,12],[13,14],[15,16],[17,18],[19,20]] +below2 = [ "Donnelly, Matt" + , "Hennings, Cawley" + , "Edwards, David" + , "Mihaljevic, Denis" + , "Gallagher, Katy" + , "Smith, David" + , "O'Connor, Sandie" + , "Wyatt, Jess" + , "Haydon, John" + , "Tye, Martin" + , "Seselja, Zed" + , "Hiatt, Jane" + , "Field, Deborah" + , "Montagne, Jessica" + , "Hobbs, Christina" + , "Wareham, Sue" + , "Kim, David William" + , "Tadros, Elizabeth" + , "Bailey, Steven" + , "Swan, Robbie" + , "Hay, Michael Gerard" + , "Hanson, Anthony" ] + main = do args <- Env.getArgs counter <- Sen.createSenateCounter (head args) above below - let testTraces = map (:[]) (zip [1,1..] below) - theCounter = Maybe.fromJust counter - results = map (\x -> (Sen.doCount theCounter x) >>= (putStrLn . (((snd . head $ x) ++ " ") ++) . show)) testTraces + let testTraces = (map (:[]) (zip [1,1..] below)) + results = map (\x -> putStrLn . (((snd . head $ x) ++ " ") ++) . show . (Sen.doCount counter) $ x) testTraces sequence_ results -- cgit