Skip to content

Instantly share code, notes, and snippets.

@flazz
Created October 13, 2009 11:38
Show Gist options
  • Save flazz/209173 to your computer and use it in GitHub Desktop.
Save flazz/209173 to your computer and use it in GitHub Desktop.
module Main where
-- input is 1.2MB
-- Tue Oct 13 08:14 2009 Time and Allocation Profiling Report (Final)
--
-- parmd +RTS -p -RTS
--
-- total time = 0.10 secs (5 ticks @ 20 ms)
-- total alloc = 491,900,336 bytes (excludes profiling overheads)
--
-- COST CENTRE MODULE %time %alloc
--
-- main Main 100.0 100.0
--
--
-- individual inherited
-- COST CENTRE MODULE no. entries %time %alloc %time %alloc
--
-- MAIN MAIN 1 0 0.0 0.0 100.0 100.0
-- CAF Main 198 3 0.0 0.0 100.0 100.0
-- format Main 206 1 0.0 0.0 0.0 0.0
-- main Main 204 1 100.0 100.0 100.0 100.0
-- format Main 207 0 0.0 0.0 0.0 0.0
-- CAF Data.Typeable 196 1 0.0 0.0 0.0 0.0
-- CAF GHC.IOBase 174 3 0.0 0.0 0.0 0.0
-- CAF GHC.Word 163 1 0.0 0.0 0.0 0.0
-- CAF Data.HashTable 151 2 0.0 0.0 0.0 0.0
-- CAF GHC.Handle 149 5 0.0 0.0 0.0 0.0
-- main Main 205 0 0.0 0.0 0.0 0.0
-- CAF GHC.Conc 148 1 0.0 0.0 0.0 0.0
-- CAF Data.Digest.MD5 119 1 0.0 0.0 0.0 0.0
-- CAF Data.Digest.MD5Aux 114 54 0.0 0.0 0.0 0.0
--
import qualified Data.ByteString.Lazy as BS
import qualified Data.Digest.MD5 as MD5
import Numeric
format n = padding ++ (showHex n "")
where padding = if n < 16 then "0" else ""
main = do
b <- BS.getContents
putStrLn $ concat $ map format (MD5.hash . BS.unpack $ b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment