[Haskell-beginners] Profiling haskell code

Sayali Kulkarni Sayali.Kulkarni at kpitcummins.com
Sun Nov 16 23:05:26 EST 2008


Hello Brent,

I just have written a quick sort program.
There is nothing more in the code than that I have shown. 

What is it about the main function?
What do I need to do in the main function? 

I do not get any errors.
And I get the expected output. The only thing that I am stuck at is that
I do not get the ".prof" file which will give me the profile details of
the code.

Also it would be great if you could through a light on whether there is
any other method to profile a code in Haskell? 

Regards,
Sayali.

-----Original Message-----
From: beginners-bounces at haskell.org
[mailto:beginners-bounces at haskell.org] On Behalf Of Brent Yorgey
Sent: Saturday, November 15, 2008 2:24 AM
To: beginners at haskell.org
Subject: Re: [Haskell-beginners] Profiling haskell code

> 
> quicksort [ ] = [ ]
> 
> quicksort (x : xs) = quicksort larger ++ [x ] ++ quicksort smaller
> 
>  
> where
> 
>  
> smaller = [a | a <- xs, a <= x ]
> 
>  
> larger = [b | b <- xs, b > x ]
> 
>  
> 
>  
> 
> When I compile the code with the following command : 
> 
>  
> 
> $ ghc --make Project.hs -prof -auto-all
>  
> Then I tested it with the following command :
>  
> $ Project +RTS -p
>  
> It generates the .hi and the .o file but I cannot get the .prof file. 
>  
> Please let me know if any of the steps is missing or where could I
check
> my profiling info. 
> 

Hi Sayali,

Is the code shown above *everything* in your Project.hs file?  You
will also need a main function for it to actually do anything.  If
there is more to your Project.hs file that you have not shown, could
you send the complete version?

Do you get any errors?  Does Project produce the output that you expect?

-Brent
_______________________________________________
Beginners mailing list
Beginners at haskell.org
http://www.haskell.org/mailman/listinfo/beginners


More information about the Beginners mailing list