<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>It is quite hard for me to tell why this entry is 
faster than the&nbsp;one one as I used the C entry as&nbsp;a starting point 
which I then refactored multiple times to ensure that the solution is closer to 
what one who right in Haskell.</FONT></DIV>
<DIV><FONT size=2 face=Arial>The only big difference I can see between the 
two&nbsp;is the different usage of list comprehension. The preceding entry was 
building a list which&nbsp;is then refined using the str method to end up being 
the list of digits. On the other hand my version use list continuation to 
recursively build&nbsp;a list of (digit, state) and then you simply have to 
print&nbsp;(map fst (tail digits)).</FONT></DIV>
<DIV><FONT size=2 face=Arial>I did not use the strictness annotations because 
they&nbsp;did&nbsp;not improve the performance when I tried to add them and I 
thought it is better to show Haskell as one would naturally write 
it.&nbsp;</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px" 
dir=ltr>
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=agocorona@gmail.com href="mailto:agocorona@gmail.com">Alberto G. 
  Corona </A></DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=arnaud.payement@gmail.com 
  href="mailto:arnaud.payement@gmail.com">Arnaud Payement</A> ; <A 
  title=haskell-cafe@haskell.org 
  href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, May 25, 2009 10:54 AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Haskell-cafe] The Computer 
  Language Benchmarks Game: pidigits</DIV>
  <DIV><BR></DIV>&gt; :<BR>&gt; &gt; By the way, I did submit my solution. It 
  improved the score a bit but it<BR>&gt; &gt; is still very memory 
  hungry.<BR><BR>&nbsp;a bit?<BR>Currentlly it is the fastest &nbsp;in 32 bit . 
  the memory/speed problems happens in 64 bit benchmarks.&nbsp;I suppose that 
  the speed is related with the memory leak that will be fixed, Dons 
  said.&nbsp;&nbsp;Event there doubled the performance of the previous entry. 
&nbsp;
  <DIV><BR></DIV>
  <DIV>Just to learn; how this last version is faster than the previous entry? 
  &nbsp;This new version does not use strictness annotations. Is this an example 
  where laziness pays (and indeed causes the memory leak in the 64 bit 
  architectures?</DIV>
  <DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>