ghc –make -prof -auto-all -O2 foo.hs

./foo.exe +RTS -p

でプロファイル foo.profができる。

./foo.exe +RTS -h

hp2ps foo.hc

でヒープ領域 foo.psができる。