Skip to content

Incorrect SCC name parsing according to user manual

The user manual says this about SCC names:

The syntax of a cost centre annotation for expressions is

{-# SCC "name" #-} <expression>

where "name" is an arbitrary string, that will become the name of your cost centre as it appears in the profiling output, and <expression> is any Haskell expression.

However GHC is actually more strict about SCC strings, for example, it doesn't accept spaces:

$ cat test.hs
main = {-# SCC "test test" #-} return ()

$ ghc test.hs
[1 of 1] Compiling Main             ( test.hs, test.o )

test.hs:1:16: error: Spaces are not allowed in SCCs
  |
1 | main = {-# SCC "test test" #-} return ()
  |                ^^^^^^^^^^^

It's also possible that GHC is right and user manual is wrong.

Trac metadata
Trac field Value
Version 8.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information