<div dir="ltr">Here is the command line log of my attempt following real world haskell's memory profiling example:<br><br>src λ stack exec -- ghc --version <br>The Glorious Glasgow Haskell Compilation System, version 7.10.3<br>src λ cat Main.hs<br>module Main where<br><br>main :: IO ()<br>main = do<br>  let x = {-# SCC sum #-}sum [1..500]<br>  print x<br>  {-# SCC helloworld #-} putStrLn "hello world"<br>src λ stack exec -- ghc -O2 --make Main.hs -prof -auto-all -caf-all -fforce-recomp<br>[1 of 1] Compiling Main             ( Main.hs, Main.o )<br>Linking Main ...<br>src λ ./Main +RTS -hc -p<br>125250<br>hello world<br>src λ cat Main.hp <br>JOB "Main +RTS -hc -p"<br>DATE "Fri Mar 11 22:51 2016"<br>SAMPLE_UNIT "seconds"<br>VALUE_UNIT "bytes"<br>BEGIN_SAMPLE 0.00<br>END_SAMPLE 0.00<br>BEGIN_SAMPLE 0.00<br>END_SAMPLE 0.00<br><br></div>