<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>I am new to Haskell. I have written a small quicksort
function in Haskell. I want to profile it for time.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>I have GHC 6.10.1 version and I have also
installed the extra-libs that it has on the Haskell home page. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>I followed the following steps for installing
the extra-libs:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<pre><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>$ cd /to/the/library/source<o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>$ runghc Setup.hs configure --enable-library-profiling<o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>$ runghc Setup.hs build<o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>$ runghc Setup.hs install<o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>Following is the quicksort code that I&#8217;m
using: <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>quicksort [ ] = [ ]<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>quicksort (x : xs) = quicksort larger ++ [x
] ++ quicksort smaller<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; smaller
= [a | a &lt;- xs, a &lt;= x ]<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; larger
= [b | b &lt;- xs, b &gt; x ]<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>When I compile the code with the following
command : <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<pre><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>$ ghc --make Project.hs -prof -auto-all<o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>Then I tested it with the following command :<o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>$ Project +RTS -p<o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>It generates the .hi and the .o file but I cannot get the .prof file. <o:p></o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>Please let me know if any of the steps is missing or where could I check my profiling info. <o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>Sayali. <o:p></o:p></span></font></p>

</div>

</body>

</html>