[Haskell] ANNOUNCE: hpc-strobe-0.1: Hpc-generated strobes for a running Haskell program

Thorkil Naur naur at post11.tele.dk
Fri May 8 15:11:35 EDT 2009

I am pleased to announce the initial release of hpc-strobe: Hpc-generated 
strobes for a running Haskell program. hpc-strobe is a rudimentary library 
that demonstrates the possibility of using Hpc (Haskell Program Coverage) to 
inspect the state of a running Haskell program. hpc-strobe-0.1 has been 
uploaded to hackage:


In ordinary use of Hpc, a single so-called tix file is produced at the end of 
a run. The tix file records how many times each expression has been used 
during the run. This can be used to mark up the source code, identifying 
expressions that have not been used.

hpc-strobe uses the basic machinery provided by Hpc to produce multiple tix 
files, also called strobes, representing the coverage at different times 
while the program is running. By subtracting such two tix files, again using 
Hpc machinery, a tix file representing the expressions used between the times 
of recording the subtracted tix files is produced. This may be used, for 
example, to get a better idea of what a long-running program is doing. It 
could also be used as a profiling tool, getting information about how many 
times individual expressions are used.

A program is included whose strobe differences produce a crude rendering of an 
analog clock when they are used to mark up the source code using Hpc. Please 
see the attached example (gunzip the file, point you browser to it, scroll 
down to view the canvas function).

Use of the library involves a simple change of the main function and also 
requires the program to be enabled for hpc. At the time of writing, this 
means using a fairly recent version of GHC and compiling the Haskell code 
with the -fhpc option.

For additional details, see the README included in the package.

Best regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.hs.html.gz
Type: application/x-gzip
Size: 3863 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell/attachments/20090508/2924e044/Main.hs.html-0001.bin

More information about the Haskell mailing list