<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-13132</id>
	<title>Nabble - Haskell - Haskell-Cafe</title>
	<updated>2008-07-24T04:06:45Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/Haskell---Haskell-Cafe-f13132.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Haskell---Haskell-Cafe-f13132.html" />
	<subtitle type="html">The Haskell Cafe</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-18629691</id>
	<title>Re: ANNOUNCE: Sun Microsystems and Haskell.org joint project on OpenSPARC</title>
	<published>2008-07-24T04:06:45Z</published>
	<updated>2008-07-24T04:06:45Z</updated>
	<author>
		<name>Duncan Coutts</name>
	</author>
	<content type="html">&lt;br&gt;On Thu, 2008-07-24 at 16:43 +1200, Richard A. O'Keefe wrote:
&lt;br&gt;&amp;gt; On 24 Jul 2008, at 3:52 am, Duncan Coutts wrote:
&lt;br&gt;&amp;gt; [Sun have donated a T5120 server + USD10k to develop
&lt;br&gt;&amp;gt; &amp;nbsp; support for Haskell on the SPARC.]
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is wonderful news.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have a 500MHz UltraSPARC II on my desktop running Solaris 2.10.
&lt;br&gt;&lt;br&gt;I have 500MHz UltraSPARC II on my desktop running Gentoo Linux. :-)
&lt;br&gt;&lt;br&gt;&amp;gt; Some time ago I tried to install GHC 6.6.1 on it, but ended up
&lt;br&gt;&amp;gt; with something that compiles to C ok, but then invokes some C
&lt;br&gt;&amp;gt; compiler with option &amp;quot;-fwrapv&amp;quot;, which no compiler on that machine
&lt;br&gt;&amp;gt; accepts, certainly none that was present when I installed it.
&lt;br&gt;&lt;br&gt;I've got ghc 6.8.2 working, but only -fvia-C and only unregisterised.
&lt;br&gt;&lt;br&gt;&amp;quot;-fwrapv&amp;quot; is an option to some version of gcc, but I couldn't tell you
&lt;br&gt;which.
&lt;br&gt;&lt;br&gt;&amp;gt; I would really love to be able to use GHC on that machine.
&lt;br&gt;&lt;br&gt;Me too :-), or in my case use it a bit quicker. Unregisterised ghc
&lt;br&gt;builds are pretty slow.
&lt;br&gt;&lt;br&gt;&amp;gt; I also have an account on a T1 server, but the research group
&lt;br&gt;&amp;gt; who Sun gave it to chose to run Linux on it, of all things.
&lt;br&gt;&lt;br&gt;Our tentative plan is to partition our T2 server using logical domains
&lt;br&gt;and run both Solaris and Linux. We'd like to set up ghc build bots on
&lt;br&gt;both OSs.
&lt;br&gt;&lt;br&gt;&amp;gt; So binary distributions for SPARC/Solaris and SPARC/Linux would
&lt;br&gt;&amp;gt; be very very nice things for this new project to deliver early.
&lt;br&gt;&lt;br&gt;I guess this is something that anyone with an account on the box could
&lt;br&gt;do. So once we get to the stage where we're handing out accounts then
&lt;br&gt;hopefully this would follow.
&lt;br&gt;&lt;br&gt;The project isn't aiming to get the registerised C backend working
&lt;br&gt;nicely, we're aiming to get a decent native backend. That should also be
&lt;br&gt;much less fragile by not depending on the version of gcc so closely.
&lt;br&gt;&lt;br&gt;&amp;gt; (Or some kind of source distribution that doesn't need a working
&lt;br&gt;&amp;gt; GHC to start with.)
&lt;br&gt;&lt;br&gt;That's a tad harder. Needs lot of build system hacking.
&lt;br&gt;&lt;br&gt;Duncan
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18629691&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/ANNOUNCE%3A-Sun-Microsystems-and-Haskell.org-joint-project-on-OpenSPARC-tp18613978p18629691.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18626720</id>
	<title>Re: ghc socket weirdness</title>
	<published>2008-07-24T00:33:15Z</published>
	<updated>2008-07-24T00:33:15Z</updated>
	<author>
		<name>Ji YongGang-2</name>
	</author>
	<content type="html">Tim Newsham &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18626720&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;newsham@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; FreeBSD/7.0 amd64:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; GHCi, version 6.8.2: &lt;a href=&quot;http://www.haskell.org/ghc/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/ghc/&lt;/a&gt;&amp;nbsp; :? for help
&lt;br&gt;&amp;gt; Loading package base ... linking ... done.
&lt;br&gt;&amp;gt; Prelude&amp;gt; :module +Network
&lt;br&gt;&amp;gt; Prelude Network&amp;gt; listenOn $ PortNumber 8765
&lt;br&gt;&amp;gt; Loading package parsec-2.1.0.0 ... linking ... done.
&lt;br&gt;&amp;gt; Loading package network-2.1.0.0 ... linking ... done.
&lt;br&gt;&amp;gt; *** Exception: getAddrInfo: does not exist (servname not supported for
&lt;br&gt;&amp;gt; ai_socktype)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (same error when compiled).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Anyone seen this before? &amp;nbsp;I have multiple NICs, could that be
&lt;br&gt;&amp;gt; confusing listenOn (does it not just bind on 0.0.0.0?)
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;ghc 6.8.2 has the same problem on NetBSD/i386, it fixed with ghc 6.8.3:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://hackage.haskell.org/trac/ghc/ticket/2103&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/trac/ghc/ticket/2103&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- jungle
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18626720&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/ghc-socket-weirdness-tp18626417p18626720.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18626417</id>
	<title>ghc socket weirdness</title>
	<published>2008-07-24T00:04:21Z</published>
	<updated>2008-07-24T00:04:21Z</updated>
	<author>
		<name>Tim Newsham</name>
	</author>
	<content type="html">FreeBSD/7.0 amd64:
&lt;br&gt;&lt;br&gt;GHCi, version 6.8.2: &lt;a href=&quot;http://www.haskell.org/ghc/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/ghc/&lt;/a&gt;&amp;nbsp; :? for help
&lt;br&gt;Loading package base ... linking ... done.
&lt;br&gt;Prelude&amp;gt; :module +Network
&lt;br&gt;Prelude Network&amp;gt; listenOn $ PortNumber 8765
&lt;br&gt;Loading package parsec-2.1.0.0 ... linking ... done.
&lt;br&gt;Loading package network-2.1.0.0 ... linking ... done.
&lt;br&gt;*** Exception: getAddrInfo: does not exist (servname not supported for 
&lt;br&gt;ai_socktype)
&lt;br&gt;&lt;br&gt;(same error when compiled).
&lt;br&gt;&lt;br&gt;Anyone seen this before? &amp;nbsp;I have multiple NICs, could that be
&lt;br&gt;confusing listenOn (does it not just bind on 0.0.0.0?)
&lt;br&gt;&lt;br&gt;Tim Newsham
&lt;br&gt;&lt;a href=&quot;http://www.thenewsh.com/~newsham/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.thenewsh.com/~newsham/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18626417&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/ghc-socket-weirdness-tp18626417p18626417.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18625450</id>
	<title>Re: ANNOUNCE: Sun Microsystems and Haskell.org joint project on OpenSPARC</title>
	<published>2008-07-23T22:03:01Z</published>
	<updated>2008-07-23T22:03:01Z</updated>
	<author>
		<name>Brandon S. Allbery KF8NH</name>
	</author>
	<content type="html">&lt;br&gt;On 2008 Jul 24, at 0:43, Richard A. O'Keefe wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; So binary distributions for SPARC/Solaris and SPARC/Linux would
&lt;br&gt;&amp;gt; be very very nice things for this new project to deliver early.
&lt;br&gt;&amp;gt; (Or some kind of source distribution that doesn't need a working
&lt;br&gt;&amp;gt; GHC to start with.
&lt;br&gt;&lt;br&gt;I'm still working on SPARC/Solaris here as well. &amp;nbsp;(Still trying to get &amp;nbsp;
&lt;br&gt;a build that doesn't produce executables that throw &amp;quot;schedule re- 
&lt;br&gt;entered unsafely&amp;quot; immediately on startup.)
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;brandon s. allbery [solaris,freebsd,perl,pugs,haskell] &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18625450&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;allbery@...&lt;/a&gt;
&lt;br&gt;system administrator [openafs,heimdal,too many hats] &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18625450&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;allbery@...&lt;/a&gt;
&lt;br&gt;electrical and computer engineering, carnegie mellon university &amp;nbsp; &amp;nbsp;KF8NH
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18625450&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/ANNOUNCE%3A-Sun-Microsystems-and-Haskell.org-joint-project-on-OpenSPARC-tp18613978p18625450.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18625326</id>
	<title>Re: ANNOUNCE: Sun Microsystems and Haskell.org joint project on OpenSPARC</title>
	<published>2008-07-23T21:43:59Z</published>
	<updated>2008-07-23T21:43:59Z</updated>
	<author>
		<name>Richard A. O'Keefe</name>
	</author>
	<content type="html">On 24 Jul 2008, at 3:52 am, Duncan Coutts wrote:
&lt;br&gt;[Sun have donated a T5120 server + USD10k to develop
&lt;br&gt;&amp;nbsp; support for Haskell on the SPARC.]
&lt;br&gt;&lt;br&gt;This is wonderful news.
&lt;br&gt;&lt;br&gt;I have a 500MHz UltraSPARC II on my desktop running Solaris 2.10.
&lt;br&gt;Some time ago I tried to install GHC 6.6.1 on it, but ended up
&lt;br&gt;with something that compiles to C ok, but then invokes some C
&lt;br&gt;compiler with option &amp;quot;-fwrapv&amp;quot;, which no compiler on that machine
&lt;br&gt;accepts, certainly none that was present when I installed it.
&lt;br&gt;&lt;br&gt;I would really love to be able to use GHC on that machine.
&lt;br&gt;&lt;br&gt;I also have an account on a T1 server, but the research group
&lt;br&gt;who Sun gave it to chose to run Linux on it, of all things.
&lt;br&gt;&lt;br&gt;So binary distributions for SPARC/Solaris and SPARC/Linux would
&lt;br&gt;be very very nice things for this new project to deliver early.
&lt;br&gt;(Or some kind of source distribution that doesn't need a working
&lt;br&gt;GHC to start with.)
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18625326&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/ANNOUNCE%3A-Sun-Microsystems-and-Haskell.org-joint-project-on-OpenSPARC-tp18613978p18625326.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18622160</id>
	<title>Re: Literate program implementing text editor</title>
	<published>2008-07-23T15:43:06Z</published>
	<updated>2008-07-23T15:43:06Z</updated>
	<author>
		<name>Duncan Coutts</name>
	</author>
	<content type="html">&lt;br&gt;On Wed, 2008-07-23 at 21:05 +0100, Eric wrote:
&lt;br&gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I wanted to embark on a Haskell program that implements a simple text 
&lt;br&gt;&amp;gt; editor. Before doing so, however, I thought that I should ask: Does 
&lt;br&gt;&amp;gt; anyone know of a literate Haskell program already in existence that does 
&lt;br&gt;&amp;gt; the job?
&lt;br&gt;&lt;br&gt;I don't know about simple, but there is Yi and once upon a time it was
&lt;br&gt;simple before everyone added lots of features to it. It's probably not
&lt;br&gt;literate Haskell though.
&lt;br&gt;&lt;br&gt;Duncan
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18622160&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Literate-program-implementing-text-editor-tp18619319p18622160.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18622043</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T15:33:20Z</published>
	<updated>2008-07-23T15:33:20Z</updated>
	<author>
		<name>Luke Palmer-2</name>
	</author>
	<content type="html">On Wed, Jul 23, 2008 at 6:10 PM, Corey O'Connor &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18622043&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;coreyoconnor@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; My straightforward Haskell solution was:
&lt;br&gt;&amp;gt; -------------------------------------------------------------------
&lt;br&gt;&amp;gt; import Text.Regex.Posix
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; main = do
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;f_lines &amp;lt;- readFile &amp;quot;test.out&amp;quot; &amp;gt;&amp;gt;= return . lines
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;let duration = foldl add_line 0.0 f_lines
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;add_line sum line =
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;let [[_,m]] = line =~ &amp;quot;([0-9.]+)&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;framerate = read m
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;delta = 1.0 / framerate
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;in sum + delta
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;putStrLn $ &amp;quot;Duration (sec): &amp;quot; ++ show duration
&lt;br&gt;&amp;gt; -------------------------------------------------------------------
&lt;/div&gt;&lt;br&gt;I'm sure the other suggestions have improved performance far more than
&lt;br&gt;this suggestion will, but it's still worth a shot.
&lt;br&gt;&lt;br&gt;I don't think I've _ever_ seen a case where using foldl was a good
&lt;br&gt;idea. &amp;nbsp; foldl interacts poorly with laziness; use foldr when the
&lt;br&gt;function you are folding is nonstrict, and use foldl' (from
&lt;br&gt;Data.List), a strict version of foldl, when the function you are
&lt;br&gt;folding is strict. &amp;nbsp;This is, of course, only a rule of thumb.
&lt;br&gt;&lt;br&gt;Changing that foldl to foldl' will probably speed this up a decent amount.
&lt;br&gt;&lt;br&gt;Luke
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18622043&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18622043.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18621994</id>
	<title>Re: BLAS Solve Example</title>
	<published>2008-07-23T15:30:16Z</published>
	<updated>2008-07-23T15:30:16Z</updated>
	<author>
		<name>Dan Weston</name>
	</author>
	<content type="html">A jedi master might stick with the existing double precision solver, 
&lt;br&gt;then convert the results to best rational approximation [1], then do a 
&lt;br&gt;forward solve on the rational versions of matrices, adjusting numerator 
&lt;br&gt;and denominator to eliminate the residual error (with a heuristic to 
&lt;br&gt;favor common factors). If you are very lucky, such a rational number 
&lt;br&gt;will exist, depending on your limits of humongous.
&lt;br&gt;&lt;br&gt;[1] e.g. &lt;a href=&quot;http://www.dtashley.com/howtos/2007/01/best_rational_approximation/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dtashley.com/howtos/2007/01/best_rational_approximation/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Darrin Thompson wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Jul 23, 2008 at 2:12 AM, Alberto Ruiz &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18621994&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aruiz@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; $ ghci solve.hs
&lt;br&gt;&amp;gt;&amp;gt; *Main&amp;gt; sol
&lt;br&gt;&amp;gt;&amp;gt; 3 |&amp;gt; [-5.555555555555511e-2,0.11111111111111113,0.2777777777777776]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I was hoping for rational solutions. If I were a true jedi master I'd
&lt;br&gt;&amp;gt; write my own solver, which might be the right thing to do. All I know
&lt;br&gt;&amp;gt; so far is gauss' method. Probably I'd learn something implementing the
&lt;br&gt;&amp;gt; back substitution. hmm....
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Darrin
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Haskell-Cafe mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18621994&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18621994&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/BLAS-Solve-Example-tp18597688p18621994.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620752</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T14:12:57Z</published>
	<updated>2008-07-23T14:12:57Z</updated>
	<author>
		<name>Miguel Mitrofanov</name>
	</author>
	<content type="html">&lt;br&gt;On 24 Jul 2008, at 00:45, Andrew Coppin wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Miguel Mitrofanov wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Also... the current Humour page on the Haskell wiki contains a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; link to Lambdabot's quotes database, but on my system, clicking &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; this link just displays a few hundred pages of gibberish. Is this &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; normal?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Of course it's not. But deciphering is very simple, it's named &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;gunzip&amp;quot;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Right... so why does it have the MIME type &amp;quot;text/plain&amp;quot;? o_O
&lt;/div&gt;&lt;br&gt;Probably because it should be in &amp;quot;Content-Encoding&amp;quot; header.
&lt;br&gt;&lt;br&gt;See, most web browsers are capable of gunzipping content - but only if &amp;nbsp;
&lt;br&gt;they know it's gzipped, so they look at the Content-Encoding header, &amp;nbsp;
&lt;br&gt;and if it's present and says &amp;quot;gzip&amp;quot;, it decompresses the content. This &amp;nbsp;
&lt;br&gt;is perfectly safe, since before receiving content browser lets the &amp;nbsp;
&lt;br&gt;server know it accepts compressed pages (by sending &amp;quot;Accept-Encoding&amp;quot; &amp;nbsp;
&lt;br&gt;header), so the server knows it can send compressed content.
&lt;br&gt;&lt;br&gt;&amp;gt; (Also... how do you know it's ZIP, and not, say, gzip, bz2, RAR, &amp;nbsp;
&lt;br&gt;&amp;gt; LHA...? I can't see anything that looks like an identifying header &amp;nbsp;
&lt;br&gt;&amp;gt; in there.)
&lt;br&gt;&lt;br&gt;Hmmm... your &amp;quot;file&amp;quot; tool doesn't know about gzip archives?
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620752&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18620752.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620704</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T14:09:08Z</published>
	<updated>2008-07-23T14:09:08Z</updated>
	<author>
		<name>Andrew Coppin</name>
	</author>
	<content type="html">Jeremy Shaw wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; At Wed, 23 Jul 2008 19:45:56 +0100,
&lt;br&gt;&amp;gt; Andrew Coppin wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; A while back I found a page somewhere containing some rather amusing IRC 
&lt;br&gt;&amp;gt;&amp;gt; quotes. Unfortunately it seems to have vanished. I can't remember where 
&lt;br&gt;&amp;gt;&amp;gt; on earth I found it, but I've scoured the Internet trying to track it 
&lt;br&gt;&amp;gt;&amp;gt; down. (In particular, it contained a quote of somebody impersonating a 
&lt;br&gt;&amp;gt;&amp;gt; typical Haskell newbie - lots of enthusiasm and no attention span! Well 
&lt;br&gt;&amp;gt;&amp;gt; it amused *me* anyway...) Anybody have any ideas where this has gone?
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://web.archive.org/web/20070609061216/http://www.haskell.org/hawiki/QuotesPage&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://web.archive.org/web/20070609061216/http://www.haskell.org/hawiki/QuotesPage&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;LOL!
&lt;br&gt;&lt;br&gt;Thanks, that's the one...
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620704&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18620704.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620517</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T14:00:50Z</published>
	<updated>2008-07-23T14:00:50Z</updated>
	<author>
		<name>Jefferson Heard-2</name>
	</author>
	<content type="html">&lt;a href=&quot;http://bash.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bash.org&lt;/a&gt;&amp;nbsp;?
&lt;br&gt;&lt;br&gt;On Wed, Jul 23, 2008 at 2:45 PM, Andrew Coppin
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620517&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewcoppin@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; A while back I found a page somewhere containing some rather amusing IRC
&lt;br&gt;&amp;gt; quotes. Unfortunately it seems to have vanished. I can't remember where on
&lt;br&gt;&amp;gt; earth I found it, but I've scoured the Internet trying to track it down. (In
&lt;br&gt;&amp;gt; particular, it contained a quote of somebody impersonating a typical Haskell
&lt;br&gt;&amp;gt; newbie - lots of enthusiasm and no attention span! Well it amused *me*
&lt;br&gt;&amp;gt; anyway...) Anybody have any ideas where this has gone?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also... the current Humour page on the Haskell wiki contains a link to
&lt;br&gt;&amp;gt; Lambdabot's quotes database, but on my system, clicking this link just
&lt;br&gt;&amp;gt; displays a few hundred pages of gibberish. Is this normal?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As I final note...
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.haskell.org/haskellwiki/Humor/Goldilocks&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/haskellwiki/Humor/Goldilocks&lt;/a&gt;&lt;br&gt;&amp;gt; Damn, I wish *I* thought of that! ;-)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Haskell-Cafe mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620517&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;I try to take things like a crow; war and chaos don't always ruin a
&lt;br&gt;picnic, they just mean you have to be careful what you swallow.
&lt;br&gt;&lt;br&gt;-- Jessica Edwards
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620517&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18620517.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620503</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T14:00:12Z</published>
	<updated>2008-07-23T14:00:12Z</updated>
	<author>
		<name>Don Stewart-2</name>
	</author>
	<content type="html">brad.larsen:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; And against gawk 3.1.5:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $ time awk -F: '{sum += 1 / $2} END{print sum}' test.out
&lt;br&gt;&amp;gt; 3155.63
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; real &amp;nbsp; &amp;nbsp;0m0.197s
&lt;br&gt;&amp;gt; user &amp;nbsp; &amp;nbsp;0m0.184s
&lt;br&gt;&amp;gt; sys &amp;nbsp; &amp;nbsp; 0m0.004s
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; compared to Don's Haskell version:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $ time ./fastSum &amp;lt; test.out
&lt;br&gt;&amp;gt; 3155.626666664377
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; real &amp;nbsp; &amp;nbsp;0m0.072s
&lt;br&gt;&amp;gt; user &amp;nbsp; &amp;nbsp;0m0.056s
&lt;br&gt;&amp;gt; sys &amp;nbsp; &amp;nbsp; 0m0.004s
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; compared to the Corey's perl version:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $ time perl Sum.pl
&lt;br&gt;&amp;gt; Duration (sec): 3155.62666666438
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; real &amp;nbsp; &amp;nbsp;0m0.181s
&lt;br&gt;&amp;gt; user &amp;nbsp; &amp;nbsp;0m0.164s
&lt;br&gt;&amp;gt; sys &amp;nbsp; &amp;nbsp; 0m0.012s
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;Another variant, using a non-copying readDouble (available in
&lt;br&gt;bytestring-lexing package 0.1.2),
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; {-# OPTIONS -fbang-patterns #-}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; import qualified Data.ByteString.Char8 &amp;nbsp;as S
&lt;br&gt;&amp;nbsp; &amp;nbsp; import qualified Data.ByteString.Unsafe as S
&lt;br&gt;&amp;nbsp; &amp;nbsp; import Data.ByteString.Lex.Double
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; main = print . go 0 =&amp;lt;&amp;lt; S.getContents
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; where
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; go :: Double -&amp;gt; S.ByteString -&amp;gt; Double
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; go !n !s = case unsafeReadDouble s' of
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nothing &amp;nbsp; &amp;nbsp; -&amp;gt; n
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Just (k,t) &amp;nbsp;-&amp;gt; let delta = 1 / k in go (n+delta) t
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s' = case S.elemIndex ':' s of
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nothing -&amp;gt; S.empty
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Just i &amp;nbsp;-&amp;gt; S.unsafeDrop (i+2) s
&lt;br&gt;&lt;br&gt;Computes in:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; $ time ./Fast &amp;lt; test.out
&lt;br&gt;&amp;nbsp; &amp;nbsp; 3155.626666664377
&lt;br&gt;&amp;nbsp; &amp;nbsp; ./Fast &amp;lt; test.out &amp;nbsp;0.02s user 0.00s system 80% cpu 0.025 total
&lt;br&gt;&lt;br&gt;So that's probably a good place to stop.
&lt;br&gt;&lt;br&gt;Note the general rules:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * strict bytestrings
&lt;br&gt;&amp;nbsp; * tight tail-recursive loops with strict, atomic accumulators
&lt;br&gt;&amp;nbsp; * non-copying parsing.
&lt;br&gt;&lt;br&gt;-- Don
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620503&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18620503.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620399</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T13:57:37Z</published>
	<updated>2008-07-23T13:57:37Z</updated>
	<author>
		<name>Jeremy Shaw-3</name>
	</author>
	<content type="html">At Wed, 23 Jul 2008 19:45:56 +0100,
&lt;br&gt;Andrew Coppin wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; A while back I found a page somewhere containing some rather amusing IRC 
&lt;br&gt;&amp;gt; quotes. Unfortunately it seems to have vanished. I can't remember where 
&lt;br&gt;&amp;gt; on earth I found it, but I've scoured the Internet trying to track it 
&lt;br&gt;&amp;gt; down. (In particular, it contained a quote of somebody impersonating a 
&lt;br&gt;&amp;gt; typical Haskell newbie - lots of enthusiasm and no attention span! Well 
&lt;br&gt;&amp;gt; it amused *me* anyway...) Anybody have any ideas where this has gone?
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://web.archive.org/web/20070609061216/http://www.haskell.org/hawiki/QuotesPage&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://web.archive.org/web/20070609061216/http://www.haskell.org/hawiki/QuotesPage&lt;/a&gt;&lt;br&gt;&lt;br&gt;j.
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620399&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18620399.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620244</id>
	<title>RE: Re: Aren't type system extensions fun? [Further analysis]</title>
	<published>2008-07-23T13:47:06Z</published>
	<updated>2008-07-23T13:47:06Z</updated>
	<author>
		<name>Simon Peyton-Jones</name>
	</author>
	<content type="html">Andrew writes
&lt;br&gt;&lt;br&gt;| I have complete confidence that whoever wrote the GHC manual knew
&lt;br&gt;| exactly what they meant. I am also fairly confident that this was the
&lt;br&gt;| same person who implemented and even designed this particular feature.
&lt;br&gt;| And that they probably have an advanced degree in type system theory. I,
&lt;br&gt;| however, do not. So if in future the GHC manual could explain this in
&lt;br&gt;| less opaque language, that would be most appreciated. :-}
&lt;br&gt;&lt;br&gt;As the person who wrote the offending section of the GHC user manual (albeit lacking a qualification of any sort in type theory), I am painfully aware of its shortcomings. &amp;nbsp;Much of the manual is imprecise, and explains things only by examples. &amp;nbsp;The wonder is that it apparently serves the purpose for many people.
&lt;br&gt;&lt;br&gt;Nevertheless, the fact is that it didn't do the job for Andrew, at least not first time around.
&lt;br&gt;&lt;br&gt;After some useful replies to his email, he wrote
&lt;br&gt;&lt;br&gt;| Thank you for coming up with a clear and comprehensible answer.
&lt;br&gt;&lt;br&gt;I would very much welcome anyone who felt able to improve on the text in the manual, even if it's only a paragraph or two. &amp;nbsp;If you stub your toe on the manual, once you find the solution, take a few minutes to write the words you wish you had read to begin with, and send them to me.
&lt;br&gt;&lt;br&gt;Meanwhile, Andrew, I recommend the paper &amp;quot;Practical type inference for arbitrary rank types&amp;quot;, which is, compared to the user manual at least, rather carefully written.
&lt;br&gt;&lt;br&gt;Simon
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620244&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Aren%27t-type-system-extensions-fun--tp17479349p18620244.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620237</id>
	<title>RE: Re: Profiling nested case</title>
	<published>2008-07-23T13:47:00Z</published>
	<updated>2008-07-23T13:47:00Z</updated>
	<author>
		<name>Simon Peyton-Jones</name>
	</author>
	<content type="html">| I had similar experiences as you when attempting to write &amp;quot;high
&lt;br&gt;| performance Haskell&amp;quot;; the language makes you want to use high-level
&lt;br&gt;| abstracted functions but the optimizer (while amazing, to be honest)
&lt;br&gt;| seems to miss a few cases that it seems like it should hit.
&lt;br&gt;&lt;br&gt;Ryan, if you find any of these, do please submit them to GHC's Trac bug-tracker. There's a special category for performance bugs. &amp;nbsp;Small programs of the form &amp;quot;GHC should hit this, but doesn't&amp;quot; are incredibly useful.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;Simon
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620237&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Profiling-nested-case-tp18375047p18620237.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18620335</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T13:45:45Z</published>
	<updated>2008-07-23T13:45:45Z</updated>
	<author>
		<name>Andrew Coppin</name>
	</author>
	<content type="html">Miguel Mitrofanov wrote:
&lt;br&gt;&amp;gt;&amp;gt; Also... the current Humour page on the Haskell wiki contains a link 
&lt;br&gt;&amp;gt;&amp;gt; to Lambdabot's quotes database, but on my system, clicking this link 
&lt;br&gt;&amp;gt;&amp;gt; just displays a few hundred pages of gibberish. Is this normal?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Of course it's not. But deciphering is very simple, it's named &amp;quot;gunzip&amp;quot;.
&lt;br&gt;&lt;br&gt;Right... so why does it have the MIME type &amp;quot;text/plain&amp;quot;? o_O
&lt;br&gt;&lt;br&gt;(Also... how do you know it's ZIP, and not, say, gzip, bz2, RAR, LHA...? 
&lt;br&gt;I can't see anything that looks like an identifying header in there.)
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18620335&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18620335.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18619993</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T13:35:43Z</published>
	<updated>2008-07-23T13:35:43Z</updated>
	<author>
		<name>Miguel Mitrofanov</name>
	</author>
	<content type="html">&amp;gt; Also... the current Humour page on the Haskell wiki contains a link &amp;nbsp;
&lt;br&gt;&amp;gt; to Lambdabot's quotes database, but on my system, clicking this link &amp;nbsp;
&lt;br&gt;&amp;gt; just displays a few hundred pages of gibberish. Is this normal?
&lt;br&gt;&lt;br&gt;Of course it's not. But deciphering is very simple, it's named &amp;quot;gunzip&amp;quot;.
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18619993&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18619993.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18619834</id>
	<title>Re: [Off-topic] Loss of humour</title>
	<published>2008-07-23T13:29:31Z</published>
	<updated>2008-07-23T13:29:31Z</updated>
	<author>
		<name>John Melesky</name>
	</author>
	<content type="html">On Jul 23, 2008, at 1:45 PM, Andrew Coppin wrote:
&lt;br&gt;&amp;gt; A while back I found a page somewhere containing some rather amusing &amp;nbsp;
&lt;br&gt;&amp;gt; IRC quotes.
&lt;br&gt;&lt;br&gt;Are you perhaps thinking of the &amp;quot;Quotes of the Week&amp;quot; section in the &amp;nbsp;
&lt;br&gt;Haskell Weekly News?
&lt;br&gt;&lt;br&gt;Back issues seem to be at &lt;a href=&quot;http://sequence.complete.org/hwn&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sequence.complete.org/hwn&lt;/a&gt;&amp;nbsp;if you want &amp;nbsp;
&lt;br&gt;to check.
&lt;br&gt;&lt;br&gt;-johnnnnnn
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18619834&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18619834.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18619471</id>
	<title>Haskell Weekly News: Issue 78 - July 23, 2008</title>
	<published>2008-07-23T13:13:45Z</published>
	<updated>2008-07-23T13:13:45Z</updated>
	<author>
		<name>Brent Yorgey-2</name>
	</author>
	<content type="html">---------------------------------------------------------------------------
&lt;br&gt;Haskell Weekly News
&lt;br&gt;&lt;a href=&quot;http://sequence.complete.org/hwn/20080723&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sequence.complete.org/hwn/20080723&lt;/a&gt;&lt;br&gt;Issue 78 - July 23, 2008
&lt;br&gt;---------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Welcome to issue 78 of HWN, a newsletter covering developments in the
&lt;br&gt;&amp;nbsp; &amp;nbsp;[1]Haskell community.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Issue 78: In Which Michi and Neil Become Doctors, Sun Donates Some
&lt;br&gt;&amp;nbsp; &amp;nbsp;Sweet Loot, and Jules Is Revealed To Be A Helpful Anthropomorphic Robot
&lt;br&gt;&lt;br&gt;Community News
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Congratulations are in order this week to two members of the community
&lt;br&gt;&amp;nbsp; &amp;nbsp;who have completed PhDs. Neil Mitchell (ndm) passed his PhD viva last
&lt;br&gt;&amp;nbsp; &amp;nbsp;week, subject to minor corrections. Mikael Johansson (Syzygy-) [2]has
&lt;br&gt;&amp;nbsp; &amp;nbsp;also completed his PhD and will soon be starting a postdoc at Stanford
&lt;br&gt;&amp;nbsp; &amp;nbsp;with the topology in computer science working group. Congratulations,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Drs. Mitchell and Johansson!
&lt;br&gt;&lt;br&gt;Announcements
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;rosezipper. Eric Kow (kowey) [3]announced the release of [4]rosezipper,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Krasimir Angelov and Iavor S. Diatchki's Data.Tree implementation of
&lt;br&gt;&amp;nbsp; &amp;nbsp;zippers.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;list-extras 0.1.0. wren ng thornton (koninkje) [5]announced the initial
&lt;br&gt;&amp;nbsp; &amp;nbsp;release of [6]list-extras, a home for common not-so-common list
&lt;br&gt;&amp;nbsp; &amp;nbsp;functions.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Sun Microsystems and Haskell.org joint project on OpenSPARC. Duncan
&lt;br&gt;&amp;nbsp; &amp;nbsp;Coutts (dcoutts) [7]announced a [8]joint project between Sun
&lt;br&gt;&amp;nbsp; &amp;nbsp;Microsystems and the Haskell.org community to exploit the high
&lt;br&gt;&amp;nbsp; &amp;nbsp;performance capabilities of Sun's latest multi-core [9]OpenSPARC
&lt;br&gt;&amp;nbsp; &amp;nbsp;systems via Haskell! Sun has donated a powerful 8 core SPARC Enterprise
&lt;br&gt;&amp;nbsp; &amp;nbsp;T5120 Server to the Haskell community, and $10,000 to fund a student
&lt;br&gt;&amp;nbsp; &amp;nbsp;to further develop support for high performance Haskell on the SPARC.
&lt;br&gt;&amp;nbsp; &amp;nbsp;The student will work with a mentor from Haskell.org and an adviser
&lt;br&gt;&amp;nbsp; &amp;nbsp;from Sun's SPARC compiler team. If you're a student and this sounds
&lt;br&gt;&amp;nbsp; &amp;nbsp;interesting to you, send in those applications!!
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Hayoo! beta 0.2. Timo B. [10]announced the second beta release of
&lt;br&gt;&amp;nbsp; &amp;nbsp;[11]Hayoo!, a Haskell API search engine providing advanced features
&lt;br&gt;&amp;nbsp; &amp;nbsp;like suggestions, find-as-you-type, fuzzy queries and much more. The
&lt;br&gt;&amp;nbsp; &amp;nbsp;major change in this release is the inclusion of all packages available
&lt;br&gt;&amp;nbsp; &amp;nbsp;on Hackage in the index.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Haskell-beginners mailing list. Benjamin L. Russell [12]announced the
&lt;br&gt;&amp;nbsp; &amp;nbsp;creation of the [13]Haskell-Beginners Mailing List, beginners at
&lt;br&gt;&amp;nbsp; &amp;nbsp;haskell.org, devoted to discussion of primarily beginner-level topics
&lt;br&gt;&amp;nbsp; &amp;nbsp;related to Haskell. It's already off to a great start, so if you're a
&lt;br&gt;&amp;nbsp; &amp;nbsp;Haskell beginner, or someone interested in answering beginner
&lt;br&gt;&amp;nbsp; &amp;nbsp;questions, please subscribe!
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Haskeline 0.2. Judah Jacobson [14]announced the initial (alpha-ish)
&lt;br&gt;&amp;nbsp; &amp;nbsp;release of [15]Haskeline, a library for line input in command-line
&lt;br&gt;&amp;nbsp; &amp;nbsp;programs. It is similar in purpose to editline or readline, but is
&lt;br&gt;&amp;nbsp; &amp;nbsp;written in Haskell and thus (hopefully) more easily used in other
&lt;br&gt;&amp;nbsp; &amp;nbsp;Haskell programs.
&lt;br&gt;&lt;br&gt;Google Summer of Code
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Progress updates from participants in the 2008 [16]Google Summer of
&lt;br&gt;&amp;nbsp; &amp;nbsp;Code.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Generic tries. Jamie Brandon is working on a library for efficient maps
&lt;br&gt;&amp;nbsp; &amp;nbsp;using generalized tries. [17]This week, he ran QuickCheck on his test
&lt;br&gt;&amp;nbsp; &amp;nbsp;suite for the first time, and found a large number of failing tests!
&lt;br&gt;&amp;nbsp; &amp;nbsp;He's got his work cut out for him straightening those out over the next
&lt;br&gt;&amp;nbsp; &amp;nbsp;few days.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;DPH physics engine. Roman Cheplyaka (Feuerbach) is working on a
&lt;br&gt;&amp;nbsp; &amp;nbsp;[18]physics engine using [19]Data Parallel Haskell. [20]This week, he
&lt;br&gt;&amp;nbsp; &amp;nbsp;implemented full handling of rigid body collisions, including angular
&lt;br&gt;&amp;nbsp; &amp;nbsp;velocity. Next he plans to explore various ways to make the engine
&lt;br&gt;&amp;nbsp; &amp;nbsp;faster, including broad-phase collision detection.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;GHC plugins. Max Bolingbroke is working on dynamically loaded plugins
&lt;br&gt;&amp;nbsp; &amp;nbsp;for GHC. [21]This week, he revealed his &amp;quot;mystery project&amp;quot;: an HTML
&lt;br&gt;&amp;nbsp; &amp;nbsp;pretty-printer for GHC core! [22]Here is a sample. Now his focus turns
&lt;br&gt;&amp;nbsp; &amp;nbsp;to tidying things up and solidifying documentation in preparation for
&lt;br&gt;&amp;nbsp; &amp;nbsp;getting his patches merged into GHC HEAD.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Hoogle 4. Neil Mitchell (ndm) is working on [23]Hoogle 4. [24]This
&lt;br&gt;&amp;nbsp; &amp;nbsp;week, he fleshed out the final part of type search, including support
&lt;br&gt;&amp;nbsp; &amp;nbsp;for instances and alpha renaming of variables. Unfortunately, it uses
&lt;br&gt;&amp;nbsp; &amp;nbsp;too much memory to be feasibly run on the base libraries! Neil has some
&lt;br&gt;&amp;nbsp; &amp;nbsp;ideas on how to fix this, however, which he plans to tackle next week.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Language.C. Benedikt Huber (visq) is [25]working on Language.C, a
&lt;br&gt;&amp;nbsp; &amp;nbsp;standalone parser/pretty printer library for C99. He has finally
&lt;br&gt;&amp;nbsp; &amp;nbsp;completed a working implementation for analysing declarations and
&lt;br&gt;&amp;nbsp; &amp;nbsp;definitions, and [26]presents a working example of the library's use.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Cabal dependency framework. Andrea Vezzosi (Saizan) is working on a
&lt;br&gt;&amp;nbsp; &amp;nbsp;[27]make-like dependency analysis framework for Cabal.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;GHC API. Thomas Schilling (nominolo) is working on [28]improvements to
&lt;br&gt;&amp;nbsp; &amp;nbsp;the GHC API.
&lt;br&gt;&lt;br&gt;Libraries
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Proposals and extensions to the [29]standard libraries.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;generalize mapAccumL/R. Ross Paterson [30]proposed adding generalized
&lt;br&gt;&amp;nbsp; &amp;nbsp;versions of mapAccumL and mapAccumR to Data.Traversable.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;signal-handling API. Simon Marlow [31]proposed a [32]new
&lt;br&gt;&amp;nbsp; &amp;nbsp;signal-handling API.
&lt;br&gt;&lt;br&gt;Discussion
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Point-free style in guards. L29Ah [33]asked a question about using a
&lt;br&gt;&amp;nbsp; &amp;nbsp;points-free style in guard expressions, leading to a number of clever
&lt;br&gt;&amp;nbsp; &amp;nbsp;suggestions involving custom combinators.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Optimizing sequence. Gracjan Polak started a [34]discussion on the
&lt;br&gt;&amp;nbsp; &amp;nbsp;strictness properties of the sequence function, and its implications
&lt;br&gt;&amp;nbsp; &amp;nbsp;for optimization. It sounds as though adding an alternate strict
&lt;br&gt;&amp;nbsp; &amp;nbsp;version of sequence to the libraries could be a good idea.
&lt;br&gt;&lt;br&gt;Blog noise
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;[35]Haskell news from the [36]blogosphere.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Eric Kow (kowey): [37]rose zipper on hackage. Eric has uploaded an
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;implementation of a zipper for Data.Tree to hackage.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Jamie Brandon: [38]QuickCheck strikes again. An update on Jamie's
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Google Summer of Code project. Lots of failing QuickCheck tests
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mean Jamie has his work cut out for him.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Ayumilove: [39]Haskell Programming Tutorial Part 1. A video
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;introduction to Haskell?
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Roman Cheplyaka (Feuerbach): [40]Status report: week 7-8. An update
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on Roman's Google Summer of Code project.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Conal Elliott (conal): [41]Designing for the future.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Benedikt Huber (visq): [42]Language.C: Analysing Definitions. An
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;update on Benedikt's Google Summer of Code project.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Max Bolingbroke: [43]Compiler Plugins For GHC: Week Six. An update
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on Max's Google Summer of Code project.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Arnar Birgisson (Arnar): [44]Playing with Haskell's lazy lists.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Arnar implements Eric Rowland's [45]simple prime-generating
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;recurrence using lazy lists in Haskell.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Neil Mitchell (ndm): [46]GSoC Hoogle: Week 8. An update on Neil's
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Google Summer of Code project.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Matthew Sackman: [47]What is the point?. Matthew had his submission
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rejected from the Haskell Symposium, and isn't happy about it.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Tupil: [48]Stemming with Haskell reloaded. An updated, more
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;functional/Haskellish interface to the stemmer library.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Luke Palmer (luqui): [49]Semantic Design. Luke's reflections on a
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;design approach learned from Conal Elliott.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Muad`Dib (vixey): [50]Rascal - Mini-haskell like language.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Jeremy Shaw: [51]HTML Templating in HAppS using HSP. Jeremy writes
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a very cool introduction/tutorial to using HSP (Haskell Server
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pages) with HAppS.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Duane Johnson: [52]Lazy Evaluation at Work. Duane likes the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;idea of lazy file I/O.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Duane Johnson: [53]A Glimmer of Monadic Hope. Duane figures out
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do-notation.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Duane Johnson: [54]Using 'foldr' in Haskell. Duane figures out
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;how to define (++) and concat in terms of foldr.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Mikael Johansson (Syzygy-): [55]Dr rer nat, Magna cum laude.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Holden Karau: [56]Integrating your HUnit (or other) tests into
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;your cabal package.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Real-World Haskell: [57]Beta availability hiccups.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Antoine Hersen: [58]ICFP 2008 Postmortem.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Edward Kmett (edwardk): [59]A Sort of Difference. Edward uses an
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;analysis of quicksort in Haskell as a jumping-off point for an
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;introduction to difference lists.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Ralf Lammel: [60]The Expression Lemma -- Explained. Ralf explains
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;the relationship between OOP and FP.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;gt;&amp;gt;&amp;gt; Greg McClure: [61]Learning languages through problem-solving.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Greg extols the virtues of [62]Project Euler for learning new
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;languages, and exhibits a solution to the first problem in Haskell,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Erlang, and Python.
&lt;br&gt;&lt;br&gt;Quotes of the Week
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* kryptiskt: my point is that our brain isn't some logic machine,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;it's a jury-rigged contraption to help us get food, friends and
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sex. It's the Perl of intelligences.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Fallacy: peyton `simon` jones
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Quadrescence: [on #haskell] Well, the nice population here attracts
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;people. Unlike other pla_C_es. How'd those underscores get there?
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* mauke: hmm, regexes get even more cryptic after z-encoding:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ZLz3fUZCZLz3fUzlznzrwZRZLz3fUzezrwZRzbZLz3fUzlzezrwZRZLz3fUznzrwZRZR
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* BMeph: Haskell: Where even the newest newcomer acts monadically:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;join :: ask (ask something) -&amp;gt; ask something
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Quadrescence: quicksilver: You must be an anthropomorphic robot or
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;something.
&lt;br&gt;&lt;br&gt;About the Haskell Weekly News
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;New editions are posted to [63]the Haskell mailing list as well as to
&lt;br&gt;&amp;nbsp; &amp;nbsp;[64]the Haskell Sequence and [65]Planet Haskell. [66]RSS is also
&lt;br&gt;&amp;nbsp; &amp;nbsp;available, and headlines appear on [67]haskell.org. Headlines are
&lt;br&gt;&amp;nbsp; &amp;nbsp;available as [68]PDF.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;To help create new editions of this newsletter, please see the
&lt;br&gt;&amp;nbsp; &amp;nbsp;information on [69]how to contribute. Send stories to byorgey at seas
&lt;br&gt;&amp;nbsp; &amp;nbsp;dot upenn dot edu. The darcs repository is available at darcs get
&lt;br&gt;&amp;nbsp; &amp;nbsp;[70]&lt;a href=&quot;http://code.haskell.org/~byorgey/code/hwn/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.haskell.org/~byorgey/code/hwn/&lt;/a&gt;&amp;nbsp;.
&lt;br&gt;&lt;br&gt;References
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;1. &lt;a href=&quot;http://haskell.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;2. &lt;a href=&quot;http://blog.mikael.johanssons.org/archive/2008/07/dr-rer-nat-magna-cum-laude/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.mikael.johanssons.org/archive/2008/07/dr-rer-nat-magna-cum-laude/&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;3. &lt;a href=&quot;http://koweycode.blogspot.com/2008/07/rose-zipper-on-hackage.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://koweycode.blogspot.com/2008/07/rose-zipper-on-hackage.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;4. &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/rosezipper&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/rosezipper&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;5. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/42485&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.cafe/42485&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;6. &lt;a href=&quot;http://code.haskell.org/~wren/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.haskell.org/~wren/&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;7. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/16351&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.general/16351&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;8. &lt;a href=&quot;http://haskell.org/opensparc/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/opensparc/&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;9. &lt;a href=&quot;http://opensparc.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://opensparc.net/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 10. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/16349&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.general/16349&lt;/a&gt;&lt;br&gt;&amp;nbsp; 11. &lt;a href=&quot;http://holumbus.fh-wedel.de/hayoo&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://holumbus.fh-wedel.de/hayoo&lt;/a&gt;&lt;br&gt;&amp;nbsp; 12. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/16345&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.general/16345&lt;/a&gt;&lt;br&gt;&amp;nbsp; 13. &lt;a href=&quot;http://www.haskell.org/mailman/listinfo/beginners&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/beginners&lt;/a&gt;&lt;br&gt;&amp;nbsp; 14. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/16343&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.general/16343&lt;/a&gt;&lt;br&gt;&amp;nbsp; 15. &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskeline&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskeline&lt;/a&gt;&lt;br&gt;&amp;nbsp; 16. &lt;a href=&quot;http://hackage.haskell.org/trac/summer-of-code/wiki/SoC2008&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/trac/summer-of-code/wiki/SoC2008&lt;/a&gt;&lt;br&gt;&amp;nbsp; 17. &lt;a href=&quot;http://jamiiecb.blogspot.com/2008/07/quickcheck-strikes-again.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jamiiecb.blogspot.com/2008/07/quickcheck-strikes-again.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 18. &lt;a href=&quot;http://haskell.org/haskellwiki/Hpysics&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/haskellwiki/Hpysics&lt;/a&gt;&lt;br&gt;&amp;nbsp; 19. &lt;a href=&quot;http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell&lt;/a&gt;&lt;br&gt;&amp;nbsp; 20. &lt;a href=&quot;http://physics-dph.blogspot.com/2008/07/status-report-week-7-8.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://physics-dph.blogspot.com/2008/07/status-report-week-7-8.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 21. &lt;a href=&quot;http://blog.omega-prime.co.uk/2008/07/21/compiler-plugins-for-ghc-week-six/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.omega-prime.co.uk/2008/07/21/compiler-plugins-for-ghc-week-six/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 22. &lt;a href=&quot;http://www.omega-prime.co.uk/files/GHC-Core-HTML.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.omega-prime.co.uk/files/GHC-Core-HTML.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 23. &lt;a href=&quot;http://code.haskell.org/hoogle/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.haskell.org/hoogle/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 24. &lt;a href=&quot;http://neilmitchell.blogspot.com/2008/07/gsoc-hoogle-week-8.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://neilmitchell.blogspot.com/2008/07/gsoc-hoogle-week-8.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 25. &lt;a href=&quot;http://www.sivity.net/projects/language.c/wiki/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sivity.net/projects/language.c/wiki/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 26. &lt;a href=&quot;http://hsbene.blogspot.com/2008/07/languagec-analysing-definitions.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hsbene.blogspot.com/2008/07/languagec-analysing-definitions.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 27. &lt;a href=&quot;http://code.haskell.org/~Saizan/cabal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.haskell.org/~Saizan/cabal&lt;/a&gt;&lt;br&gt;&amp;nbsp; 28. &lt;a href=&quot;http://hackage.haskell.org/trac/ghc/wiki/GhcApiStatus&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/trac/ghc/wiki/GhcApiStatus&lt;/a&gt;&lt;br&gt;&amp;nbsp; 29. &lt;a href=&quot;http://haskell.org/haskellwiki/Library_submissions&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/haskellwiki/Library_submissions&lt;/a&gt;&lt;br&gt;&amp;nbsp; 30. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.libraries/9649&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.libraries/9649&lt;/a&gt;&lt;br&gt;&amp;nbsp; 31. &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.libraries/9599&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.haskell.libraries/9599&lt;/a&gt;&lt;br&gt;&amp;nbsp; 32. &lt;a href=&quot;http://hackage.haskell.org/trac/ghc/ticket/2451&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/trac/ghc/ticket/2451&lt;/a&gt;&lt;br&gt;&amp;nbsp; 33. &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.cafe/42475&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://thread.gmane.org/gmane.comp.lang.haskell.cafe/42475&lt;/a&gt;&lt;br&gt;&amp;nbsp; 34. &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.cafe/42453&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://thread.gmane.org/gmane.comp.lang.haskell.cafe/42453&lt;/a&gt;&lt;br&gt;&amp;nbsp; 35. &lt;a href=&quot;http://planet.haskell.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://planet.haskell.org/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 36. &lt;a href=&quot;http://haskell.org/haskellwiki/Blog_articles&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/haskellwiki/Blog_articles&lt;/a&gt;&lt;br&gt;&amp;nbsp; 37. &lt;a href=&quot;http://koweycode.blogspot.com/2008/07/rose-zipper-on-hackage.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://koweycode.blogspot.com/2008/07/rose-zipper-on-hackage.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 38. &lt;a href=&quot;http://jamiiecb.blogspot.com/2008/07/quickcheck-strikes-again.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jamiiecb.blogspot.com/2008/07/quickcheck-strikes-again.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 39. &lt;a href=&quot;http://www.5min.com/Video/Ayumilove-Haskell-Programming-Tutorial-Part-1-31180892&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.5min.com/Video/Ayumilove-Haskell-Programming-Tutorial-Part-1-31180892&lt;/a&gt;&lt;br&gt;&amp;nbsp; 40. &lt;a href=&quot;http://physics-dph.blogspot.com/2008/07/status-report-week-7-8.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://physics-dph.blogspot.com/2008/07/status-report-week-7-8.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 41. &lt;a href=&quot;http://feeds.feedburner.com/~r/conal/~3/342784118/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://feeds.feedburner.com/~r/conal/~3/342784118/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 42. &lt;a href=&quot;http://hsbene.blogspot.com/2008/07/languagec-analysing-definitions.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hsbene.blogspot.com/2008/07/languagec-analysing-definitions.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 43. &lt;a href=&quot;http://blog.omega-prime.co.uk/2008/07/21/compiler-plugins-for-ghc-week-six/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.omega-prime.co.uk/2008/07/21/compiler-plugins-for-ghc-week-six/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 44. &lt;a href=&quot;http://www.hvergi.net/2008/07/playing-with-haskells-lazy-lists/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.hvergi.net/2008/07/playing-with-haskells-lazy-lists/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 45. &lt;a href=&quot;http://recursed.blogspot.com/2008/07/rutgers-graduate-student-finds-new.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://recursed.blogspot.com/2008/07/rutgers-graduate-student-finds-new.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 46. &lt;a href=&quot;http://neilmitchell.blogspot.com/2008/07/gsoc-hoogle-week-8.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://neilmitchell.blogspot.com/2008/07/gsoc-hoogle-week-8.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 47. &lt;a href=&quot;http://www.wellquite.org/what_is_the_point.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.wellquite.org/what_is_the_point.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 48. &lt;a href=&quot;http://blog.tupil.com/stemming-with-haskell-reloaded/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.tupil.com/stemming-with-haskell-reloaded/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 49. &lt;a href=&quot;http://luqui.org/blog/archives/2008/07/18/semantic-design/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://luqui.org/blog/archives/2008/07/18/semantic-design/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 50. &lt;a href=&quot;http://muaddibspace.blogspot.com/2008/07/rascal-mini-haskell-like-language.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://muaddibspace.blogspot.com/2008/07/rascal-mini-haskell-like-language.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 51. &lt;a href=&quot;http://nhlab.blogspot.com/2008/07/html-templating-in-happs-using-hsp.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nhlab.blogspot.com/2008/07/html-templating-in-happs-using-hsp.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 52. &lt;a href=&quot;http://blog.inquirylabs.com/2008/07/18/lazy-evaluation-at-work/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.inquirylabs.com/2008/07/18/lazy-evaluation-at-work/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 53. &lt;a href=&quot;http://blog.inquirylabs.com/2008/07/17/a-glimmer-of-monadic-hope/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.inquirylabs.com/2008/07/17/a-glimmer-of-monadic-hope/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 54. &lt;a href=&quot;http://blog.inquirylabs.com/2008/07/17/using-foldr-in-haskell/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.inquirylabs.com/2008/07/17/using-foldr-in-haskell/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 55. &lt;a href=&quot;http://blog.mikael.johanssons.org/archive/2008/07/dr-rer-nat-magna-cum-laude/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.mikael.johanssons.org/archive/2008/07/dr-rer-nat-magna-cum-laude/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 56. &lt;a href=&quot;http://feeds.feedburner.com/~r/holdenkarau/iYtm/~3/337908379/integrating-your-hunit-or-other-tests.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://feeds.feedburner.com/~r/holdenkarau/iYtm/~3/337908379/integrating-your-hunit-or-other-tests.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 57. &lt;a href=&quot;http://www.realworldhaskell.org/blog/2008/07/16/beta-availability-hiccups/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.realworldhaskell.org/blog/2008/07/16/beta-availability-hiccups/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 58. &lt;a href=&quot;http://endymion2021.livejournal.com/17117.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://endymion2021.livejournal.com/17117.html&lt;/a&gt;&lt;br&gt;&amp;nbsp; 59. &lt;a href=&quot;http://comonad.com/reader/2008/a-sort-of-difference/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://comonad.com/reader/2008/a-sort-of-difference/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 60. &lt;a href=&quot;http://blogs.msdn.com/ralflammel/archive/2008/07/16/the-expression-lemma-explained.aspx&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blogs.msdn.com/ralflammel/archive/2008/07/16/the-expression-lemma-explained.aspx&lt;/a&gt;&lt;br&gt;&amp;nbsp; 61. &lt;a href=&quot;http://www.codechops.com/?p=15&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.codechops.com/?p=15&lt;/a&gt;&lt;br&gt;&amp;nbsp; 62. &lt;a href=&quot;http://www.projecteuler.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.projecteuler.net/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 63. &lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell&lt;/a&gt;&lt;br&gt;&amp;nbsp; 64. &lt;a href=&quot;http://sequence.complete.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sequence.complete.org/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 65. &lt;a href=&quot;http://planet.haskell.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://planet.haskell.org/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 66. &lt;a href=&quot;http://sequence.complete.org/node/feed&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sequence.complete.org/node/feed&lt;/a&gt;&lt;br&gt;&amp;nbsp; 67. &lt;a href=&quot;http://haskell.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/&lt;/a&gt;&lt;br&gt;&amp;nbsp; 68. &lt;a href=&quot;http://code.haskell.org/~byorgey/code/hwn/archives/20080723.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.haskell.org/~byorgey/code/hwn/archives/20080723.pdf&lt;/a&gt;&lt;br&gt;&amp;nbsp; 69. &lt;a href=&quot;http://haskell.org/haskellwiki/HWN&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://haskell.org/haskellwiki/HWN&lt;/a&gt;&lt;br&gt;&amp;nbsp; 70. &lt;a href=&quot;http://code.haskell.org/~byorgey/code/hwn/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.haskell.org/~byorgey/code/hwn/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18619471&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Haskell-Weekly-News%3A-Issue-78---July-23%2C-2008-tp18619471p18619471.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18619319</id>
	<title>Literate program implementing text editor</title>
	<published>2008-07-23T13:05:39Z</published>
	<updated>2008-07-23T13:05:39Z</updated>
	<author>
		<name>Eric-175</name>
	</author>
	<content type="html">Hi all,
&lt;br&gt;&lt;br&gt;I wanted to embark on a Haskell program that implements a simple text 
&lt;br&gt;editor. Before doing so, however, I thought that I should ask: Does 
&lt;br&gt;anyone know of a literate Haskell program already in existence that does 
&lt;br&gt;the job?
&lt;br&gt;&lt;br&gt;Eric M.
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18619319&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Literate-program-implementing-text-editor-tp18619319p18619319.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18619494</id>
	<title>Re: Re: Optimizing 'sequence'</title>
	<published>2008-07-23T12:52:45Z</published>
	<updated>2008-07-23T12:52:45Z</updated>
	<author>
		<name>Andrew Coppin</name>
	</author>
	<content type="html">Janis Voigtlaender wrote:
&lt;br&gt;&amp;gt; How about some QuickChecking in connection with the &amp;quot;Chasing bottoms&amp;quot;
&lt;br&gt;&amp;gt; library (&lt;a href=&quot;http://citeseer.ist.psu.edu/704350.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://citeseer.ist.psu.edu/704350.html&lt;/a&gt;)?
&lt;br&gt;&lt;br&gt;Ah, finally a reference to what this curios phrase is actually about...!
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18619494&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Optimizing-%27sequence%27-tp18575161p18619494.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18618736</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T12:37:08Z</published>
	<updated>2008-07-23T12:37:08Z</updated>
	<author>
		<name>Corey O'Connor</name>
	</author>
	<content type="html">On Wed, Jul 23, 2008 at 2:23 PM, Justin Bailey &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618736&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jgbailey@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Jul 23, 2008 at 11:10 AM, Corey O'Connor &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618736&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;coreyoconnor@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; I still have two questions after all this:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;- Can I get a Haskell implementation as fast as the Perl?
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;- What do I need to do to get GHC's profiler to provide me usable
&lt;br&gt;&amp;gt;&amp;gt; information? Telling me that 98% of the time was in &amp;quot;main&amp;quot; is not very
&lt;br&gt;&amp;gt;&amp;gt; enlightening ;-)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Don did a great job answering teh first question. To get better
&lt;br&gt;&amp;gt; profiling information, add &amp;quot;SCC&amp;quot; annotations to your code. That will
&lt;br&gt;&amp;gt; tell you how much time is spent in a particular expression. For your
&lt;br&gt;&amp;gt; main function, take a divide and conquer approach - add SCCs to
&lt;br&gt;&amp;gt; determine what is taking the most time.
&lt;/div&gt;&lt;br&gt;I did write a version of SumTiny.hs with SCC annotations:
&lt;br&gt;&lt;a href=&quot;http://tothepowerofdisco.com/repo/sum_optimization/SumTinyProf.hs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tothepowerofdisco.com/repo/sum_optimization/SumTinyProf.hs&lt;/a&gt;&lt;br&gt;Maybe I'm missing something, but the profiling still gives me poor
&lt;br&gt;results. Here is the results from the profiler (cut down and, no
&lt;br&gt;doubt, with poor post-email formatting):
&lt;br&gt;-------------------------------------------------------------------
&lt;br&gt;COST CENTRE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%time %alloc
&lt;br&gt;&lt;br&gt;do &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;92.8 &amp;nbsp; 87.6
&lt;br&gt;regex &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.8 &amp;nbsp; &amp;nbsp;4.8
&lt;br&gt;add_line &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.2 &amp;nbsp; &amp;nbsp;0.4
&lt;br&gt;div &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.1 &amp;nbsp; &amp;nbsp;0.3
&lt;br&gt;readFile &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.6 &amp;nbsp; &amp;nbsp;6.2
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;individual &amp;nbsp; &amp;nbsp;inherited
&lt;br&gt;COST CENTRE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%time %alloc &amp;nbsp; %time %alloc
&lt;br&gt;&lt;br&gt;MAIN
&lt;br&gt;CAF &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; 100.0 &amp;nbsp;100.0
&lt;br&gt;&amp;nbsp;main &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; 100.0 &amp;nbsp;100.0
&lt;br&gt;&amp;nbsp; do &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;92.8 &amp;nbsp; 87.6 &amp;nbsp; 100.0 &amp;nbsp;100.0
&lt;br&gt;&amp;nbsp; &amp;nbsp;show &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; &amp;nbsp; 0.0 &amp;nbsp; &amp;nbsp;0.0
&lt;br&gt;&amp;nbsp; &amp;nbsp;foldl &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0 &amp;nbsp; &amp;nbsp;0.3 &amp;nbsp; &amp;nbsp; 0.0 &amp;nbsp; &amp;nbsp;0.3
&lt;br&gt;&amp;nbsp; &amp;nbsp;add_line &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.2 &amp;nbsp; &amp;nbsp;0.4 &amp;nbsp; &amp;nbsp; 6.6 &amp;nbsp; &amp;nbsp;5.9
&lt;br&gt;&amp;nbsp; &amp;nbsp; regex &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.8 &amp;nbsp; &amp;nbsp;4.8 &amp;nbsp; &amp;nbsp; 2.8 &amp;nbsp; &amp;nbsp;4.8
&lt;br&gt;&amp;nbsp; &amp;nbsp; sum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0 &amp;nbsp; &amp;nbsp;0.1 &amp;nbsp; &amp;nbsp; 0.0 &amp;nbsp; &amp;nbsp;0.1
&lt;br&gt;&amp;nbsp; &amp;nbsp; div &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.1 &amp;nbsp; &amp;nbsp;0.3 &amp;nbsp; &amp;nbsp; 1.1 &amp;nbsp; &amp;nbsp;0.3
&lt;br&gt;&amp;nbsp; &amp;nbsp; read Double &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.6 &amp;nbsp; &amp;nbsp;0.2 &amp;nbsp; &amp;nbsp; 0.6 &amp;nbsp; &amp;nbsp;0.2
&lt;br&gt;&amp;nbsp; &amp;nbsp;readFile &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.6 &amp;nbsp; &amp;nbsp;6.2 &amp;nbsp; &amp;nbsp; 0.6 &amp;nbsp; &amp;nbsp;6.2
&lt;br&gt;-------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Which tells me the &amp;quot;do&amp;quot; expression that main is equal to is
&lt;br&gt;responsible for 92.8% of the run time. Which really doesn't tell me
&lt;br&gt;anything.
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;-Corey O'Connor
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618736&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18618736.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18618731</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T12:37:00Z</published>
	<updated>2008-07-23T12:37:00Z</updated>
	<author>
		<name>Brad Larsen</name>
	</author>
	<content type="html">And against gawk 3.1.5:
&lt;br&gt;&lt;br&gt;$ time awk -F: '{sum += 1 / $2} END{print sum}' test.out
&lt;br&gt;3155.63
&lt;br&gt;&lt;br&gt;real &amp;nbsp; &amp;nbsp;0m0.197s
&lt;br&gt;user &amp;nbsp; &amp;nbsp;0m0.184s
&lt;br&gt;sys &amp;nbsp; &amp;nbsp; 0m0.004s
&lt;br&gt;&lt;br&gt;compared to Don's Haskell version:
&lt;br&gt;&lt;br&gt;$ time ./fastSum &amp;lt; test.out
&lt;br&gt;3155.626666664377
&lt;br&gt;&lt;br&gt;real &amp;nbsp; &amp;nbsp;0m0.072s
&lt;br&gt;user &amp;nbsp; &amp;nbsp;0m0.056s
&lt;br&gt;sys &amp;nbsp; &amp;nbsp; 0m0.004s
&lt;br&gt;&lt;br&gt;compared to the Corey's perl version:
&lt;br&gt;&lt;br&gt;$ time perl Sum.pl
&lt;br&gt;Duration (sec): 3155.62666666438
&lt;br&gt;&lt;br&gt;real &amp;nbsp; &amp;nbsp;0m0.181s
&lt;br&gt;user &amp;nbsp; &amp;nbsp;0m0.164s
&lt;br&gt;sys &amp;nbsp; &amp;nbsp; 0m0.012s
&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Brad Larsen
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Wed, 23 Jul 2008 15:01:24 -0400, Don Stewart &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618731&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dons@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; coreyoconnor:
&lt;br&gt;&amp;gt;&amp;gt; I have the need to regularly write tiny programs that analyze output
&lt;br&gt;&amp;gt;&amp;gt; logs. The output logs don't have a consistent formatting so I
&lt;br&gt;&amp;gt;&amp;gt; typically choose Perl for these tasks.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The latest instance of having to write such a program was simple
&lt;br&gt;&amp;gt;&amp;gt; enough I figured I'd try my hand at using Haskell instead. The short
&lt;br&gt;&amp;gt;&amp;gt; story is that I could quickly write a Haskell program that achieved
&lt;br&gt;&amp;gt;&amp;gt; the goal. Yay! However, the performance was ~8x slower than a
&lt;br&gt;&amp;gt;&amp;gt; comparable Perl implementation. With a lot of effort I got the Haskell
&lt;br&gt;&amp;gt;&amp;gt; version to only 2x slower. A lot of the optimization was done with
&lt;br&gt;&amp;gt;&amp;gt; guesses that the performance difference was due to how each line was
&lt;br&gt;&amp;gt;&amp;gt; being read from the file. I couldn't determine much using GHC's
&lt;br&gt;&amp;gt;&amp;gt; profiler.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; {-# OPTIONS -fbang-patterns #-}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; import qualified Data.ByteString.Char8 as S
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; import Data.ByteString.Lex.Double
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; import Debug.Trace
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; main = print . go 0 =&amp;lt;&amp;lt; S.getContents
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; where
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; go !n !s = case readDouble str of
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nothing &amp;nbsp; &amp;nbsp; -&amp;gt; n
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Just (k,t) &amp;nbsp;-&amp;gt; let delta = 1.0 / k in go (n+delta) t
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (_, xs) = S.break ((==) ':') s
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str &amp;nbsp; &amp;nbsp; = S.drop 2 xs
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It uses the bytestring-lexing package on Hackage to read the Doubles
&lt;br&gt;&amp;gt; out,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; $ ghc --make Fast.hs -O2 -fvia-C -optc-O2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; $ time &amp;nbsp;./Fast &amp;lt; test.out
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 3155.626666664377
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ./Fast &amp;lt; test.out &amp;nbsp;0.07s user 0.01s system 97% cpu 0.078 total
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So that's twice as fast as the perl entry on my box,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; $ time perl Sum.pl &amp;lt; test.out
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Duration (sec): 3155.62666666438
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; perl Sum.pl &amp;lt; test.out &amp;nbsp;0.15s user 0.03s system 100% cpu 0.180 total
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Note that the safe Double lexer uses a bit of copying, so
&lt;br&gt;&amp;gt; we can in fact do better still with a non-copying Double parser,
&lt;br&gt;&amp;gt; but that's only for the hardcore.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- Don
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Haskell-Cafe mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618731&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618731&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18618731.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18618560</id>
	<title>Libevent FFI problems</title>
	<published>2008-07-23T12:28:32Z</published>
	<updated>2008-07-23T12:28:32Z</updated>
	<author>
		<name>Levi Greenspan</name>
	</author>
	<content type="html">Dear list members,
&lt;br&gt;&lt;br&gt;This is my first attempt to create a FFI to libevent
&lt;br&gt;(&lt;a href=&quot;http://monkey.org/~provos/libevent/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://monkey.org/~provos/libevent/&lt;/a&gt;) which is an event notification
&lt;br&gt;library. A simple usage example is for instance given here:
&lt;br&gt;&lt;a href=&quot;http://unx.ca/log/libevent_echosrv1c/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://unx.ca/log/libevent_echosrv1c/&lt;/a&gt;&amp;nbsp;. In C one basically creates
&lt;br&gt;struct event instances which are initialized with a callback function
&lt;br&gt;and the kind of event (e.g. read) one is intested in. Optionally a
&lt;br&gt;data argument can be given which will be passed to the callback
&lt;br&gt;function when invoked eventually. An event dispatcher loop will invoke
&lt;br&gt;the callback when the event occurs.
&lt;br&gt;&lt;br&gt;I have attached my first attempt at a FFI to libevent. However it
&lt;br&gt;doesn't work correctly. In the client code I want to pass 99 as data
&lt;br&gt;to the callback function, but what is printed out is 0. I guess there
&lt;br&gt;is an issue with pointer derefencing, but I don't know.
&lt;br&gt;&lt;br&gt;Also I am not sure how to handle the FunPtr deallocation. Since the
&lt;br&gt;FunPtr is stored in the foreign event structure I don't know when I
&lt;br&gt;can free it.
&lt;br&gt;&lt;br&gt;I would be grateful for any advices, hints or comments. And I really
&lt;br&gt;look forward to the FFI section in the &amp;quot;Real World Haskell&amp;quot; book.
&lt;br&gt;&lt;br&gt;Thank you very much.
&lt;br&gt;&lt;br&gt;- Levi
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;&lt;tt&gt;[main.hs]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;module Main where
&lt;br&gt;&lt;br&gt;import System.IO
&lt;br&gt;import Network.Socket
&lt;br&gt;import Network.Stream
&lt;br&gt;import Network.HTTP
&lt;br&gt;import Network.URI
&lt;br&gt;import Control.Monad
&lt;br&gt;import Control.Exception
&lt;br&gt;import Control.Concurrent
&lt;br&gt;import System.Posix.IO
&lt;br&gt;import System.Posix.Types
&lt;br&gt;&lt;br&gt;import Event as E
&lt;br&gt;import qualified Data.Map as Map
&lt;br&gt;&lt;br&gt;callback :: Fd -&amp;gt; E.EventType -&amp;gt; Int -&amp;gt; IO ()
&lt;br&gt;callback fd e x = do
&lt;br&gt;&amp;nbsp; &amp;nbsp; print fd
&lt;br&gt;&amp;nbsp; &amp;nbsp; print e
&lt;br&gt;&amp;nbsp; &amp;nbsp; print x
&lt;br&gt;&lt;br&gt;main :: IO ()
&lt;br&gt;main = 
&lt;br&gt;&amp;nbsp; &amp;nbsp; withSocketsDo $ do
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; E.init
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; addrinfos &amp;lt;- getAddrInfo (Just (defaultHints {addrFlags = [AI_PASSIVE]}))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Nothing 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(Just &amp;quot;1234&amp;quot;)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let serveraddr = head addrinfos
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- create server socket
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sock &amp;lt;- socket (addrFamily serveraddr) Stream defaultProtocol
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- bind it to the address we're listening to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bindSocket sock (addrAddress serveraddr)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- start listening for connection requests
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- max. connection requests waiting to be accepted = 5 (max. queue size)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; listen sock 5
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ev &amp;lt;- E.createEvent (Fd (fdSocket sock)) [E.ReadEvent, E.WriteEvent] callback 99
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; E.addEvent ev Nothing
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; E.dispatch
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ()
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618560&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://www.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;hsevent.hsc&lt;/strong&gt; (4K) &lt;a href=&quot;http://www.nabble.com/attachment/18618560/0/hsevent.hsc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Libevent-FFI-problems-tp18618560p18618560.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18618490</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T12:23:48Z</published>
	<updated>2008-07-23T12:23:48Z</updated>
	<author>
		<name>Justin Bailey</name>
	</author>
	<content type="html">On Wed, Jul 23, 2008 at 11:10 AM, Corey O'Connor &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618490&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;coreyoconnor@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; I still have two questions after all this:
&lt;br&gt;&amp;gt; &amp;nbsp;- Can I get a Haskell implementation as fast as the Perl?
&lt;br&gt;&amp;gt; &amp;nbsp;- What do I need to do to get GHC's profiler to provide me usable
&lt;br&gt;&amp;gt; information? Telling me that 98% of the time was in &amp;quot;main&amp;quot; is not very
&lt;br&gt;&amp;gt; enlightening ;-)
&lt;br&gt;&lt;br&gt;Don did a great job answering teh first question. To get better
&lt;br&gt;profiling information, add &amp;quot;SCC&amp;quot; annotations to your code. That will
&lt;br&gt;tell you how much time is spent in a particular expression. For your
&lt;br&gt;main function, take a divide and conquer approach - add SCCs to
&lt;br&gt;determine what is taking the most time.
&lt;br&gt;&lt;br&gt;Take Don's advice first though before benchmarking - you probably
&lt;br&gt;won't care after switching to bytestring &amp; a better regex engine.
&lt;br&gt;&lt;br&gt;Justin
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618490&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18618490.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18618078</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T12:01:24Z</published>
	<updated>2008-07-23T12:01:24Z</updated>
	<author>
		<name>Don Stewart-2</name>
	</author>
	<content type="html">coreyoconnor:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I have the need to regularly write tiny programs that analyze output
&lt;br&gt;&amp;gt; logs. The output logs don't have a consistent formatting so I
&lt;br&gt;&amp;gt; typically choose Perl for these tasks.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The latest instance of having to write such a program was simple
&lt;br&gt;&amp;gt; enough I figured I'd try my hand at using Haskell instead. The short
&lt;br&gt;&amp;gt; story is that I could quickly write a Haskell program that achieved
&lt;br&gt;&amp;gt; the goal. Yay! However, the performance was ~8x slower than a
&lt;br&gt;&amp;gt; comparable Perl implementation. With a lot of effort I got the Haskell
&lt;br&gt;&amp;gt; version to only 2x slower. A lot of the optimization was done with
&lt;br&gt;&amp;gt; guesses that the performance difference was due to how each line was
&lt;br&gt;&amp;gt; being read from the file. I couldn't determine much using GHC's
&lt;br&gt;&amp;gt; profiler.
&lt;/div&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; {-# OPTIONS -fbang-patterns #-}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; import qualified Data.ByteString.Char8 as S
&lt;br&gt;&amp;nbsp; &amp;nbsp; import Data.ByteString.Lex.Double
&lt;br&gt;&amp;nbsp; &amp;nbsp; import Debug.Trace
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; main = print . go 0 =&amp;lt;&amp;lt; S.getContents
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; where
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; go !n !s = case readDouble str of
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nothing &amp;nbsp; &amp;nbsp; -&amp;gt; n
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Just (k,t) &amp;nbsp;-&amp;gt; let delta = 1.0 / k in go (n+delta) t
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (_, xs) = S.break ((==) ':') s
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str &amp;nbsp; &amp;nbsp; = S.drop 2 xs
&lt;br&gt;&lt;br&gt;It uses the bytestring-lexing package on Hackage to read the Doubles 
&lt;br&gt;out,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; $ ghc --make Fast.hs -O2 -fvia-C -optc-O2
&lt;br&gt;&amp;nbsp; &amp;nbsp; $ time &amp;nbsp;./Fast &amp;lt; test.out
&lt;br&gt;&amp;nbsp; &amp;nbsp; 3155.626666664377
&lt;br&gt;&amp;nbsp; &amp;nbsp; ./Fast &amp;lt; test.out &amp;nbsp;0.07s user 0.01s system 97% cpu 0.078 total
&lt;br&gt;&lt;br&gt;So that's twice as fast as the perl entry on my box,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; $ time perl Sum.pl &amp;lt; test.out
&lt;br&gt;&amp;nbsp; &amp;nbsp; Duration (sec): 3155.62666666438
&lt;br&gt;&amp;nbsp; &amp;nbsp; perl Sum.pl &amp;lt; test.out &amp;nbsp;0.15s user 0.03s system 100% cpu 0.180 total
&lt;br&gt;&lt;br&gt;Note that the safe Double lexer uses a bit of copying, so
&lt;br&gt;we can in fact do better still with a non-copying Double parser,
&lt;br&gt;but that's only for the hardcore.
&lt;br&gt;&lt;br&gt;-- Don
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18618078&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18618078.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18617863</id>
	<title>InterleavableIO</title>
	<published>2008-07-23T11:50:33Z</published>
	<updated>2008-07-23T11:50:33Z</updated>
	<author>
		<name>Marco Túlio Gontijo e Silva</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I've done a package based on the Jules Bean's e-mail [1] to
&lt;br&gt;Haskell-Café, with a more generalized implementation. &amp;nbsp;In the original
&lt;br&gt;version, you could use InterleavableIO with StateT Int IO (), but not
&lt;br&gt;with StateT Int (ReaderT Char IO) (). &amp;nbsp;In this version, this is
&lt;br&gt;possible. &amp;nbsp;The package, interleavableIO, is available at [2]. &amp;nbsp;I've also
&lt;br&gt;done an application that generates a version of a module with
&lt;br&gt;generalized parameters, called interleavableGen, available at [3]. &amp;nbsp;This
&lt;br&gt;is very alpha, and interleavableGen has been tested only with
&lt;br&gt;Control.Exception yet.
&lt;br&gt;&lt;br&gt;Comments are very welcome.
&lt;br&gt;&lt;br&gt;Greetings.
&lt;br&gt;&lt;br&gt;[1]: &lt;a href=&quot;http://www.haskell.org/pipermail/haskell-cafe/2007-July/028501.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/pipermail/haskell-cafe/2007-July/028501.html&lt;/a&gt;&lt;br&gt;[2]:
&lt;br&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interleavableIO-0.0.1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interleavableIO-0.0.1&lt;/a&gt;&lt;br&gt;[3]:
&lt;br&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interleavableGen-0.0.1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interleavableGen-0.0.1&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;﻿Marco Túlio Gontijo e Silva
&lt;br&gt;Página: &lt;a href=&quot;http://marcotmarcot.googlepages.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://marcotmarcot.googlepages.com/&lt;/a&gt;&lt;br&gt;Blog: &lt;a href=&quot;http://marcotmarcot.blogspot.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://marcotmarcot.blogspot.com/&lt;/a&gt;&lt;br&gt;Correio: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617863&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marcot@...&lt;/a&gt;
&lt;br&gt;XMPP: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617863&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marcot@...&lt;/a&gt;
&lt;br&gt;IRC: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617863&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marcot@...&lt;/a&gt;
&lt;br&gt;Telefone: 25151920
&lt;br&gt;Celular: 98116720
&lt;br&gt;Endereço:
&lt;br&gt;&amp;nbsp;Rua Turfa, 639/701
&lt;br&gt;&amp;nbsp;Prado 30410-370
&lt;br&gt;&amp;nbsp;Belo Horizonte/MG Brasil
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617863&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/InterleavableIO-tp18617863p18617863.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18619487</id>
	<title>[Off-topic] Loss of humour</title>
	<published>2008-07-23T11:45:56Z</published>
	<updated>2008-07-23T11:45:56Z</updated>
	<author>
		<name>Andrew Coppin</name>
	</author>
	<content type="html">A while back I found a page somewhere containing some rather amusing IRC 
&lt;br&gt;quotes. Unfortunately it seems to have vanished. I can't remember where 
&lt;br&gt;on earth I found it, but I've scoured the Internet trying to track it 
&lt;br&gt;down. (In particular, it contained a quote of somebody impersonating a 
&lt;br&gt;typical Haskell newbie - lots of enthusiasm and no attention span! Well 
&lt;br&gt;it amused *me* anyway...) Anybody have any ideas where this has gone?
&lt;br&gt;&lt;br&gt;Also... the current Humour page on the Haskell wiki contains a link to 
&lt;br&gt;Lambdabot's quotes database, but on my system, clicking this link just 
&lt;br&gt;displays a few hundred pages of gibberish. Is this normal?
&lt;br&gt;&lt;br&gt;As I final note...
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/haskellwiki/Humor/Goldilocks&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/haskellwiki/Humor/Goldilocks&lt;/a&gt;&lt;br&gt;Damn, I wish *I* thought of that! ;-)
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18619487&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-Off-topic--Loss-of-humour-tp18619487p18619487.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18617372</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T11:26:51Z</published>
	<updated>2008-07-23T11:26:51Z</updated>
	<author>
		<name>Corey O'Connor</name>
	</author>
	<content type="html">Sounds great! Thanks for the advice. :-)
&lt;br&gt;&lt;br&gt;-Corey
&lt;br&gt;&lt;br&gt;On Wed, Jul 23, 2008 at 1:18 PM, Don Stewart &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617372&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dons@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; coreyoconnor:
&lt;br&gt;&amp;gt;&amp;gt; I have the need to regularly write tiny programs that analyze output
&lt;br&gt;&amp;gt;&amp;gt; logs. The output logs don't have a consistent formatting so I
&lt;br&gt;&amp;gt;&amp;gt; typically choose Perl for these tasks.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The latest instance of having to write such a program was simple
&lt;br&gt;&amp;gt;&amp;gt; enough I figured I'd try my hand at using Haskell instead. The short
&lt;br&gt;&amp;gt;&amp;gt; story is that I could quickly write a Haskell program that achieved
&lt;br&gt;&amp;gt;&amp;gt; the goal. Yay! However, the performance was ~8x slower than a
&lt;br&gt;&amp;gt;&amp;gt; comparable Perl implementation. With a lot of effort I got the Haskell
&lt;br&gt;&amp;gt;&amp;gt; version to only 2x slower. A lot of the optimization was done with
&lt;br&gt;&amp;gt;&amp;gt; guesses that the performance difference was due to how each line was
&lt;br&gt;&amp;gt;&amp;gt; being read from the file. I couldn't determine much using GHC's
&lt;br&gt;&amp;gt;&amp;gt; profiler.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I still have two questions after all this:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;- Can I get a Haskell implementation as fast as the Perl?
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;- What do I need to do to get GHC's profiler to provide me usable
&lt;br&gt;&amp;gt;&amp;gt; information? Telling me that 98% of the time was in &amp;quot;main&amp;quot; is not very
&lt;br&gt;&amp;gt;&amp;gt; enlightening ;-)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; All the code and data for this little experiment I've placed here:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://tothepowerofdisco.com/repo/sum_optimization/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tothepowerofdisco.com/repo/sum_optimization/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; My first, and shortest, version is SumTiny.hs. The optimized version
&lt;br&gt;&amp;gt;&amp;gt; is SumFast.hs.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The long version for the curious:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The (cleaned up) data was a 78k line file consisting of lines like the
&lt;br&gt;&amp;gt;&amp;gt; following:
&lt;br&gt;&amp;gt;&amp;gt; framerate (prev == no pts): 15
&lt;br&gt;&amp;gt;&amp;gt; framerate (delta): 25
&lt;br&gt;&amp;gt;&amp;gt; framerate (invalid timebase): 12.5
&lt;br&gt;&amp;gt;&amp;gt; ... and so on.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The need was for a program that calculated 1.0 / framerate for each
&lt;br&gt;&amp;gt;&amp;gt; line and produced the sum. Easy no?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; My straightforward Haskell solution was:
&lt;br&gt;&amp;gt;&amp;gt; -------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt; import Text.Regex.Posix
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; main = do
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; f_lines &amp;lt;- readFile &amp;quot;test.out&amp;quot; &amp;gt;&amp;gt;= return . lines
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; let duration = foldl add_line 0.0 f_lines
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add_line sum line =
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let [[_,m]] = line =~ &amp;quot;([0-9.]+)&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; framerate = read m
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delta = 1.0 / framerate
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in sum + delta
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; putStrLn $ &amp;quot;Duration (sec): &amp;quot; ++ show duration
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Could you try using lazy and/or strict bytestrings. For *any* IO
&lt;br&gt;&amp;gt; performance issue, that should be your first stop.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; See, e.g., this sum-file example,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&amp;lang=ghc&amp;id=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&amp;lang=ghc&amp;id=6&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; which outperforms C on the benchmark.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The second point would be to avoid Text.Regex.Posix, which is
&lt;br&gt;&amp;gt; algorithmically much worse than the PCRE regexes used by perl. Instead,
&lt;br&gt;&amp;gt; try the pcre-light or regex-pcre packages, which have both better
&lt;br&gt;&amp;gt; complexity, and operate on efficient bytestrings.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Finally, there's some small details about writing efficient loops. Give
&lt;br&gt;&amp;gt; type declarations for atomic types like Int and Double, and use strict
&lt;br&gt;&amp;gt; folds or explicit recursion, as in this post,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For your task here, with those simple changes, it should be relatively
&lt;br&gt;&amp;gt; easy to produce competitive-with-C performance.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- Don
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;-Corey O'Connor
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617372&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18617372.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18617232</id>
	<title>Re: More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T11:18:49Z</published>
	<updated>2008-07-23T11:18:49Z</updated>
	<author>
		<name>Don Stewart-2</name>
	</author>
	<content type="html">coreyoconnor:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I have the need to regularly write tiny programs that analyze output
&lt;br&gt;&amp;gt; logs. The output logs don't have a consistent formatting so I
&lt;br&gt;&amp;gt; typically choose Perl for these tasks.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The latest instance of having to write such a program was simple
&lt;br&gt;&amp;gt; enough I figured I'd try my hand at using Haskell instead. The short
&lt;br&gt;&amp;gt; story is that I could quickly write a Haskell program that achieved
&lt;br&gt;&amp;gt; the goal. Yay! However, the performance was ~8x slower than a
&lt;br&gt;&amp;gt; comparable Perl implementation. With a lot of effort I got the Haskell
&lt;br&gt;&amp;gt; version to only 2x slower. A lot of the optimization was done with
&lt;br&gt;&amp;gt; guesses that the performance difference was due to how each line was
&lt;br&gt;&amp;gt; being read from the file. I couldn't determine much using GHC's
&lt;br&gt;&amp;gt; profiler.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I still have two questions after all this:
&lt;br&gt;&amp;gt; &amp;nbsp;- Can I get a Haskell implementation as fast as the Perl?
&lt;br&gt;&amp;gt; &amp;nbsp;- What do I need to do to get GHC's profiler to provide me usable
&lt;br&gt;&amp;gt; information? Telling me that 98% of the time was in &amp;quot;main&amp;quot; is not very
&lt;br&gt;&amp;gt; enlightening ;-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; All the code and data for this little experiment I've placed here:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://tothepowerofdisco.com/repo/sum_optimization/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tothepowerofdisco.com/repo/sum_optimization/&lt;/a&gt;&lt;br&gt;&amp;gt; My first, and shortest, version is SumTiny.hs. The optimized version
&lt;br&gt;&amp;gt; is SumFast.hs.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The long version for the curious:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The (cleaned up) data was a 78k line file consisting of lines like the
&lt;br&gt;&amp;gt; following:
&lt;br&gt;&amp;gt; framerate (prev == no pts): 15
&lt;br&gt;&amp;gt; framerate (delta): 25
&lt;br&gt;&amp;gt; framerate (invalid timebase): 12.5
&lt;br&gt;&amp;gt; ... and so on.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The need was for a program that calculated 1.0 / framerate for each
&lt;br&gt;&amp;gt; line and produced the sum. Easy no?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; My straightforward Haskell solution was:
&lt;br&gt;&amp;gt; -------------------------------------------------------------------
&lt;br&gt;&amp;gt; import Text.Regex.Posix
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; main = do
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; f_lines &amp;lt;- readFile &amp;quot;test.out&amp;quot; &amp;gt;&amp;gt;= return . lines
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; let duration = foldl add_line 0.0 f_lines
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add_line sum line =
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let [[_,m]] = line =~ &amp;quot;([0-9.]+)&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; framerate = read m
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delta = 1.0 / framerate
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in sum + delta
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; putStrLn $ &amp;quot;Duration (sec): &amp;quot; ++ show duration
&lt;/div&gt;&lt;br&gt;Could you try using lazy and/or strict bytestrings. For *any* IO
&lt;br&gt;performance issue, that should be your first stop.
&lt;br&gt;&lt;br&gt;See, e.g., this sum-file example,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&amp;lang=ghc&amp;id=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&amp;lang=ghc&amp;id=6&lt;/a&gt;&lt;br&gt;&lt;br&gt;which outperforms C on the benchmark.
&lt;br&gt;&lt;br&gt;The second point would be to avoid Text.Regex.Posix, which is
&lt;br&gt;algorithmically much worse than the PCRE regexes used by perl. Instead,
&lt;br&gt;try the pcre-light or regex-pcre packages, which have both better
&lt;br&gt;complexity, and operate on efficient bytestrings.
&lt;br&gt;&lt;br&gt;Finally, there's some small details about writing efficient loops. Give
&lt;br&gt;type declarations for atomic types like Int and Double, and use strict
&lt;br&gt;folds or explicit recursion, as in this post,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast&lt;/a&gt;&lt;br&gt;&lt;br&gt;For your task here, with those simple changes, it should be relatively
&lt;br&gt;easy to produce competitive-with-C performance.
&lt;br&gt;&lt;br&gt;-- Don
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617232&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18617232.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18617043</id>
	<title>More fun with micro-benchmarks and optimizations. (GHC vs Perl)</title>
	<published>2008-07-23T11:10:05Z</published>
	<updated>2008-07-23T11:10:05Z</updated>
	<author>
		<name>Corey O'Connor</name>
	</author>
	<content type="html">I have the need to regularly write tiny programs that analyze output
&lt;br&gt;logs. The output logs don't have a consistent formatting so I
&lt;br&gt;typically choose Perl for these tasks.
&lt;br&gt;&lt;br&gt;The latest instance of having to write such a program was simple
&lt;br&gt;enough I figured I'd try my hand at using Haskell instead. The short
&lt;br&gt;story is that I could quickly write a Haskell program that achieved
&lt;br&gt;the goal. Yay! However, the performance was ~8x slower than a
&lt;br&gt;comparable Perl implementation. With a lot of effort I got the Haskell
&lt;br&gt;version to only 2x slower. A lot of the optimization was done with
&lt;br&gt;guesses that the performance difference was due to how each line was
&lt;br&gt;being read from the file. I couldn't determine much using GHC's
&lt;br&gt;profiler.
&lt;br&gt;&lt;br&gt;I still have two questions after all this:
&lt;br&gt;&amp;nbsp;- Can I get a Haskell implementation as fast as the Perl?
&lt;br&gt;&amp;nbsp;- What do I need to do to get GHC's profiler to provide me usable
&lt;br&gt;information? Telling me that 98% of the time was in &amp;quot;main&amp;quot; is not very
&lt;br&gt;enlightening ;-)
&lt;br&gt;&lt;br&gt;All the code and data for this little experiment I've placed here:
&lt;br&gt;&lt;a href=&quot;http://tothepowerofdisco.com/repo/sum_optimization/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tothepowerofdisco.com/repo/sum_optimization/&lt;/a&gt;&lt;br&gt;My first, and shortest, version is SumTiny.hs. The optimized version
&lt;br&gt;is SumFast.hs.
&lt;br&gt;&lt;br&gt;The long version for the curious:
&lt;br&gt;&lt;br&gt;The (cleaned up) data was a 78k line file consisting of lines like the
&lt;br&gt;following:
&lt;br&gt;framerate (prev == no pts): 15
&lt;br&gt;framerate (delta): 25
&lt;br&gt;framerate (invalid timebase): 12.5
&lt;br&gt;... and so on.
&lt;br&gt;&lt;br&gt;The need was for a program that calculated 1.0 / framerate for each
&lt;br&gt;line and produced the sum. Easy no?
&lt;br&gt;&lt;br&gt;My straightforward Haskell solution was:
&lt;br&gt;-------------------------------------------------------------------
&lt;br&gt;import Text.Regex.Posix
&lt;br&gt;&lt;br&gt;main = do
&lt;br&gt;&amp;nbsp; &amp;nbsp; f_lines &amp;lt;- readFile &amp;quot;test.out&amp;quot; &amp;gt;&amp;gt;= return . lines
&lt;br&gt;&amp;nbsp; &amp;nbsp; let duration = foldl add_line 0.0 f_lines
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add_line sum line =
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let [[_,m]] = line =~ &amp;quot;([0-9.]+)&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; framerate = read m
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delta = 1.0 / framerate
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in sum + delta
&lt;br&gt;&amp;nbsp; &amp;nbsp; putStrLn $ &amp;quot;Duration (sec): &amp;quot; ++ show duration
&lt;br&gt;-------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Just for fun I decided to compare it to a Perl implementation:
&lt;br&gt;-------------------------------------------------------------------
&lt;br&gt;#!/usr/bin/perl
&lt;br&gt;my @f_lines = split(/\n/,`cat test.out`);
&lt;br&gt;my $sum = 0.0;
&lt;br&gt;foreach(@f_lines)
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; /([0-9.]+)/;
&lt;br&gt;&amp;nbsp; &amp;nbsp; my $delta = 1.0 / $1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; $sum += $delta;
&lt;br&gt;}
&lt;br&gt;print(&amp;quot;Duration (sec): &amp;quot;, $sum, &amp;quot;\n&amp;quot;);
&lt;br&gt;-------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;(I'm sure there are other ways to write this same program in both languages.)
&lt;br&gt;I was pretty happy with how the Haskell implementation's code compared
&lt;br&gt;to the Perl implementation's just in terms of looks. Though I think
&lt;br&gt;the Perl implementation is easier to understand at the part where the
&lt;br&gt;regex match is extracted.
&lt;br&gt;&lt;br&gt;For fun I compared the performance of the two:
&lt;br&gt;(64bit linux running on a 2.4ghz Core2Duo)
&lt;br&gt;&lt;br&gt;$ time perl ./Sum.pl
&lt;br&gt;Duration (sec): 3155.62666666438
&lt;br&gt;&lt;br&gt;real &amp;nbsp; &amp;nbsp;0m0.121s
&lt;br&gt;user &amp;nbsp; &amp;nbsp;0m0.103s
&lt;br&gt;sys &amp;nbsp; &amp;nbsp; 0m0.016s
&lt;br&gt;&lt;br&gt;$ time ./SumTiny
&lt;br&gt;Duration (sec): 3155.626666664377
&lt;br&gt;&lt;br&gt;real &amp;nbsp; &amp;nbsp;0m1.099s
&lt;br&gt;user &amp;nbsp; &amp;nbsp;0m1.073s
&lt;br&gt;sys &amp;nbsp; &amp;nbsp; 0m0.009s
&lt;br&gt;&lt;br&gt;Youch! ~1s is fast enough that I don't care, but I'm still curious why
&lt;br&gt;there is a 8x performance difference. Profiling with manual cost
&lt;br&gt;center annotations (See SumTinyProf.hs) indicated the &amp;quot;do&amp;quot; expression
&lt;br&gt;main is equal to was responsible 90% of the tiny. Which isn't
&lt;br&gt;revealing at all!
&lt;br&gt;&lt;br&gt;Some experimenting led me to find a 2x slower implementation
&lt;br&gt;(SumFast.hs). Quick notes ont he changes I made:
&lt;br&gt;&amp;nbsp;- Used ByteStrings instead of String.
&lt;br&gt;&amp;nbsp;- Used hGetLine instead of reading the entire file lazily and splitting on &amp;quot;\n&amp;quot;
&lt;br&gt;&amp;nbsp;- Fusing the foldl' with the loop of reading each line from the file.
&lt;br&gt;&amp;nbsp;- Using bang patterns to make the fused loop strict on the
&lt;br&gt;accumulator argument.
&lt;br&gt;&lt;br&gt;I think the largest performance gain was from changing how each line
&lt;br&gt;was read from the file. The lazy read and split seemed very slow
&lt;br&gt;compared to a loop that used hGetLine.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;-Corey O'Connor
&lt;br&gt;_______________________________________________
&lt;br&gt;Haskell-Cafe mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18617043&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Haskell-Cafe@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell-cafe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell-cafe&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/More-fun-with-micro-benchmarks-and-optimizations.-%28GHC-vs-Perl%29-tp18617043p18617043.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18616615</id>
	<title>Re: Re: Optimizing 'sequence'</title>
	<published>2008-07-23T10:48:23Z</published>
	<updated>2008-07-23T10:48:23Z</updated>
	<author>
		<name>Don Stewart-2</name>
	</author>
	<content type="html">gracjanpolak:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Chaddaï Fouché &