diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-11-23 11:22:03 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-11-28 11:37:43 +0000 |
commit | 57d657a8d7d149bc6a39f7f1ce3da6f5c69a6d51 (patch) | |
tree | 874129a9cd2dd93b1f6448a4633c99029d9c9138 /docs/users_guide/profiling.xml | |
parent | df43fcd5e7c331c71c323e8fa91e69c7e0f404e4 (diff) | |
download | haskell-57d657a8d7d149bc6a39f7f1ce3da6f5c69a6d51.tar.gz |
Allow the quotes to be omitted in {-# SCC "<varid>" #-}
Diffstat (limited to 'docs/users_guide/profiling.xml')
-rw-r--r-- | docs/users_guide/profiling.xml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/docs/users_guide/profiling.xml b/docs/users_guide/profiling.xml index 0cf2e0e59f..a5a1d4911c 100644 --- a/docs/users_guide/profiling.xml +++ b/docs/users_guide/profiling.xml @@ -287,7 +287,12 @@ MAIN MAIN 102 0 0.0 0.0 100.0 100.0 <literal><expression></literal> is any Haskell expression. An <literal>SCC</literal> annotation extends as far to the right as possible when parsing. (SCC stands for "Set - Cost Centre").</para> + Cost Centre"). The double quotes can be omitted + if <literal>name</literal> is a Haskell identifier, for example:</para> + +<programlisting> + {-# SCC my_function #-} <expression> +</programlisting> <para>Here is an example of a program with a couple of SCCs:</para> @@ -295,10 +300,10 @@ MAIN MAIN 102 0 0.0 0.0 100.0 100.0 main :: IO () main = do let xs = [1..1000000] let ys = [1..2000000] - print $ {-# SCC "last_xs" #-} last xs - print $ {-# SCC "last_init_xs" #-} last $ init xs - print $ {-# SCC "last_ys" #-} last ys - print $ {-# SCC "last_init_ys" #-}last $ init ys + print $ {-# SCC last_xs #-} last xs + print $ {-# SCC last_init_xs #-} last $ init xs + print $ {-# SCC last_ys #-} last ys + print $ {-# SCC last_init_ys #-}last $ init ys </programlisting> <para>which gives this profile when run:</para> |