Last active
February 16, 2017 20:33
-
-
Save deque-blog/3205b5bc531960cce02bdd51cde4a9c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data ContestResult = ContestResult { | |
prefixScore :: Int , | |
infixScore :: Int } | |
deriving (Show) | |
runContest :: Int -> IO () | |
runContest size = do | |
expressions <- generate (replicateM 1000 (genExpr size)) | |
let run printer = sum $ map (length . printer . optimize) expressions | |
print $ ContestResult (run prn) (run prnInfix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment