Created
November 13, 2013 21:20
Three files, one with only main, one with main + non-referenced IO object, one with main + referenced IO object (technically, one with a larger main IO object). The non-referenced IO object is never compiled, as the resulting object files have the same md5sum.
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
-- test1.hs | |
-- No dead code: compiles to 1.22M executable | |
-- with stripped .o 1320 byes | |
-- .o file md5sum: 35ccd1647c772a5757fba3ae8bfa6542 | |
main :: IO () | |
main = getLine >>= print | |
-- test2.hs | |
-- With dead code: compiles to 1.22M executable | |
-- with stripped .o 1320 byes | |
-- .o file md5sum: 35ccd1647c772a5757fba3ae8bfa6542 | |
main :: IO () | |
main = getLine >>= print | |
unreached :: IO () | |
unreached = putStrLn "What are you doing here?" | |
-- test3.hs | |
-- "Control": compiles to 1.23M executable | |
-- with stripped .o 1448 byes | |
-- .o file md5sum: 09b15c76ecae08c9b5be7564808602f1 | |
main :: IO () | |
main = getLine >>= reached | |
reached :: String -> IO () | |
reached s = print (tail s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment