Let

import Control.Monad main = do forM_ [1..1000] $ \i -> if mod i 2 == 0 then putStrLn "Foo" else print i

and run with

ghc -rtsopts -prof -fprof-auto z.hs && ./z +RTS -p && cat z.prof

then, following rules to set cost centres

COST CENTRE MODULE %time %alloc main.\ Main 80.0 84.4 main Main 20.0 13.2 CAF GHC.IO.Handle.FD 0.0 2.1

the backslashes show that stack level, you can set names for each one

forM_ [1..1000] $ \i -> {-# SCC "myBranch" #-} if mod i 2 == 0 then putStrLn "Foo" else print i

and now

COST CENTRE MODULE %time %alloc myBranch Main 90.0 84.4 main Main 10.0 13.2 CAF GHC.IO.Handle.FD 0.0 2.1

(Added @trVoldemort comment)

Also, (...) seems to be used for let assignments with computations involved

data T = T Int (IO ()) (IO ()) main = forM_ [T (mod i 2) (putStrLn "Foo") (print i) | i <- [1..1000]] $ \q -> let T a b c = q -- Will be `(...)` in if a == 0 then b else c

with profile output

main.\ Main main.\.b Main main.\.c Main main.\.(...) Main main.\.a Main

with SCC pragma

forM_ [T (mod i 2) (putStrLn "Foo") (print i) | i <- [1..1000]] $ \q -> let T a b c = {-# SCC "myBind" #-} q in if a == 0 then b else c

and output