<!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=Courier>Hi all, </FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Courier>I recently decided to rewrite the pidigits 
benchmark of the debian shootout (shootout.alioth.debian.org) as toy 
project.<BR>However, it seems that on my machine, the code seems to be more 
performant than both the current entry and the proposed replacement (see 
</FONT><A href=""><FONT 
face=Courier>http://www.haskell.org/haskellwiki/Shootout/Pidigits</FONT></A><FONT 
face=Courier>) for the same number of lines. <BR>Do you think it might be worth 
submitting my entry? Here is my code,:</FONT></FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Courier>{-# OPTIONS -O2 -optc-O3 #-}<BR>--<BR>-- 
The Great Computer Language Shootout<BR>-- </FONT><A href=""><FONT 
face=Courier>http://shootout.alioth.debian.org/</FONT></A><BR><FONT 
face=Courier>-- by Arnaud Payement<BR>--</FONT></FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Courier>import System</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Courier>data F = F Integer Integer Integer 
Integer</FONT></DIV>
<DIV><FONT size=2 face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Courier>extract </FONT><A href=""><FONT 
face=Courier>s@(F</FONT></A><FONT face=Courier> k n a d) = ((n*3+a) `div` d, 
(n*4+a) `div` d, s)</FONT></FONT></DIV>
<DIV><FONT size=2 face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Courier>update (F k n a d) = F (k+1) (n*k) ((a+n*2)*y) 
(d*y) where y = 2*k+1</FONT></DIV>
<DIV><FONT size=2 face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Courier>next state = let (u, v, </FONT><A 
href=""><FONT face=Courier>s'@(F</FONT></A><FONT face=Courier> k n a d)) = 
extract (update state) in<BR>&nbsp; if (n &gt; a || (u /= v)) then next s' else 
(show u, F k (n*10) ((a-d*u)*10) d)<BR>&nbsp; <BR>digits = ("", (F 1 1 0 
1)):[next state | state &lt;- map snd digits]</FONT></FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Courier>pr (d:t) k n | k &gt; n = putStr 
""<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 
k `mod` 10 /= 0 = putStr d &gt;&gt; pr t (k+1) 
n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 
otherwise = putStrLn (d ++ "\t:" ++ show k) &gt;&gt; pr t (k+1) n</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Courier>main = pr (map fst (tail digits)) 1 . read . head 
=&lt;&lt; getArgs</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Courier>Best,<BR>Arnaud</FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN 
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 13px arial; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,128,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0" 
class=Apple-style-span></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV></BODY></HTML>