<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">

<channel>
	<title>Planet Haskell</title>
	<link>http://planet.haskell.org/</link>
	<language>en</language>
	<description>Planet Haskell - http://planet.haskell.org/</description>

<item>
	<title>Holden Karau: Your browser history is showing (an open source web application in
scheme)</title>
	<guid isPermalink="false">tag:blogger.com,1999:blog-23427281.post-6000308871991291936</guid>
	<link>http://feedproxy.google.com/~r/holdenkarau/iYtm/~3/ct8v80W_15k/your-browser-history-is-showing-open_02.html</link>
	<description>&lt;div&gt;&lt;a href=&quot;http://www.flickr.com/photos/holdenk/3681499979/&quot; title=&quot;photo sharing&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2617/3681499979_741d149af4_m.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span&gt;&lt;a href=&quot;http://www.flickr.com/photos/holdenk/3681499979/&quot;&gt;my web2.0collage&lt;/a&gt;&lt;br /&gt;Originally uploaded by &lt;a href=&quot;http://www.flickr.com/people/holdenk/&quot;&gt;dmcopernicus&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;Over the course of last weekend I wrote &lt;a href=&quot;http://web2.0collage.com/?q=myblog&quot;&gt;web2.0collage, a browser history sniffing collage generator&lt;/a&gt; in scheme. &lt;a href=&quot;http://web2.0collage.com/?q=myblog&quot;&gt;Web2.0collage&lt;/a&gt; is designed to graphically illustrate just how easy it is for sites to determine what your browser history is. When you visit the site it sniffs your browser history, and creates a collage of the (safe for work) sites that you visit. It is an interesting application of potentially scary technology (imagine a job application site using this to screen candidates). Ideally, given some time in my schedule, I'd like to make it a bit more user friendly and robust so that I could perhaps show it to the general public to increase awareness of privacy issues on the web.&lt;br /&gt;&lt;br /&gt;The code, while not good since I was learning how the plt-webserver &amp;amp; imagemagick bindings worked at the time, is &lt;a href=&quot;http://web2.0collage.com/sl1.tar.bz2?q=myblog&quot;&gt;available&lt;/a&gt; under the agpl. Today it &lt;a href=&quot;http://yro.slashdot.org/story/09/07/02/1317205/Your-Browser-History-Is-Showing?art_pos=8&quot;&gt;hit the front page of slashdot&lt;/a&gt;, causing some less than fortunate scaling issues to be discovered. Hatguy &amp;amp; myself managed to fix them (sort of) without too many interruptions.&lt;br clear=&quot;all&quot; /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/23427281-6000308871991291936?l=blog.holdenkarau.com&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?a=ct8v80W_15k:jhCqVBdNDI8:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?d=yIl2AUoC8zA&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?a=ct8v80W_15k:jhCqVBdNDI8:63t7Ie-LG7Y&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?d=63t7Ie-LG7Y&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?a=ct8v80W_15k:jhCqVBdNDI8:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?i=ct8v80W_15k:jhCqVBdNDI8:V_sGLiPBpWU&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?a=ct8v80W_15k:jhCqVBdNDI8:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?d=7Q72WNTAKBA&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?a=ct8v80W_15k:jhCqVBdNDI8:qj6IDK7rITs&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?d=qj6IDK7rITs&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?a=ct8v80W_15k:jhCqVBdNDI8:gIN9vFwOqvQ&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/holdenkarau/iYtm?i=ct8v80W_15k:jhCqVBdNDI8:gIN9vFwOqvQ&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/holdenkarau/iYtm/~4/ct8v80W_15k&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 02 Jul 2009 11:36:37 +0000</pubDate>
	<dc:creator>Holden Karau (holden@pigscanfly.ca)</dc:creator>
</item>
<item>
	<title>Michael Snoyman: Hack sample- chat server</title>
	<guid isPermalink="false">http://blog.snoyman.com/?p=47</guid>
	<link>http://blog.snoyman.com/2009/07/01/hack-sample-chat-server/</link>
	<description>&lt;p&gt;Not that you&amp;#8217;ll want to replace IRC with this any time soon, but I&amp;#8217;ve put together an incredibly simplistic chat server to demonstrate Hack. The code is available in &lt;a href=&quot;http://github.com/snoyberg/hack-samples/tree/master&quot;&gt;my hack-samples github repo&lt;/a&gt;. I&amp;#8217;m not going to copy the source code here, but point out a few cool pieces.&lt;/p&gt;
&lt;p&gt;In the imports list, I say &lt;code&gt;import qualified Hack.Handler.SimpleServer&lt;/code&gt; as Handler to use the SimpleServer handler. Later on, I use &lt;code&gt;Handler.run 3000&lt;/code&gt; to run a simple server on port 3000. If you instead replace SimpleServer with CGI and remove the 3000, you immediately have a CGI application. Of course, all of the MVar concurrency code is unneeded overhead in a CGI application, but you could also use Happstack, FastCGI or any other handler.&lt;/p&gt;
&lt;p&gt;Also, I alluded in my previous post to the idea of using currying to initiate some stuff. This code is a perfect example. In my main function, I load up data from a text file, create a &lt;code&gt;Handle&lt;/code&gt; to write to, wrap them both in &lt;code&gt;MVar&lt;/code&gt;s and use that to curry the app function. This way, all of that initialization code only gets called once, no matter how many requests are served. This is a simple approach which works very well in production.&lt;/p&gt;
&lt;p&gt;Not much more to say, I think the code speaks for itself!&lt;/p&gt;</description>
	<pubDate>Wed, 01 Jul 2009 21:31:19 +0000</pubDate>
	<dc:creator>admin</dc:creator>
</item>
<item>
	<title>Luke Palmer: On the By functions</title>
	<guid isPermalink="false">http://lukepalmer.wordpress.com/?p=990</guid>
	<link>http://lukepalmer.wordpress.com/2009/07/01/on-the-by-functions/</link>
	<description>&lt;div class=&quot;snap_preview&quot;&gt;&lt;br /&gt;&lt;p&gt;Here&amp;#8217;s a quick little note that has been bugging me for a while, and nobody wants to talk about it right now on IRC.&lt;/p&gt;
&lt;p&gt;I think the &lt;i&gt;By&lt;/i&gt; functions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;
sortBy :: (a -&amp;gt; a -&amp;gt; Ordering) -&amp;gt; [a] -&amp;gt; [a]
maximumBy :: (a -&amp;gt; a -&amp;gt; Ordering) -&amp;gt; [a] -&amp;gt; a
groupBy :: (a -&amp;gt; a -&amp;gt; Bool) -&amp;gt; [a] -&amp;gt; [[a]]
nubBy :: (a -&amp;gt; a -&amp;gt; Bool) -&amp;gt; [a] -&amp;gt; [a]
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Etc. should be replaced by &lt;i&gt;On&lt;/i&gt; functions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;
sortOn :: (Ord b) =&amp;gt; (a -&amp;gt; b) -&amp;gt; [a] -&amp;gt; [a]
maximumOn :: (Ord b) =&amp;gt; (a -&amp;gt; b) -&amp;gt; [a] -&amp;gt; a
groupOn :: (Eq b) =&amp;gt; (a -&amp;gt; b) -&amp;gt; [a] -&amp;gt; [[a]]
nubOn :: (Eq b) =&amp;gt; (a -&amp;gt; b) -&amp;gt; [a] -&amp;gt; [a]
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;My argument is: the functions provided to sortBy etc. have some preconditions.  sortBy is not well-defined (or oughtn&amp;#8217;t be) for functions which are not linear ordering functions; nubBy is shouldn&amp;#8217;t be well-defined (to the dismay of some 31337s) for functions which do not encode an equivalence relation.  But the folklore is that functions are typically &amp;#8220;as total as possible&amp;#8221;, so if it wants a function of some type, all I have to do is conjure a function of that type and my output will be something reasonable in terms of that function.&lt;/p&gt;
&lt;p&gt;On the other hand, the folklore of typeclasses is that they typically come with laws.  You need to prove &amp;#8212; or at least think you know how to prove &amp;#8212; some laws when you make a type an instance of a typeclass.  The &lt;i&gt;On&lt;/i&gt; functions use this obligation to encode their precondition.  They are easier to use in a verified setting, too; there are a bunch of standard instances of Eq and Ord for which the laws are known to hold; map your data on to that &lt;i&gt;in any way you like&lt;/i&gt; and the precondition is guaranteed. &lt;/p&gt;
&lt;p&gt;Thoughts?&lt;/p&gt;
  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/lukepalmer.wordpress.com/990/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/lukepalmer.wordpress.com/990/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/lukepalmer.wordpress.com/990/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/lukepalmer.wordpress.com/990/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/lukepalmer.wordpress.com/990/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/lukepalmer.wordpress.com/990/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/lukepalmer.wordpress.com/990/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/lukepalmer.wordpress.com/990/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/lukepalmer.wordpress.com/990/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/lukepalmer.wordpress.com/990/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=lukepalmer.wordpress.com&amp;amp;blog=5292379&amp;amp;post=990&amp;amp;subd=lukepalmer&amp;amp;ref=&amp;amp;feed=1&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Wed, 01 Jul 2009 19:51:12 +0000</pubDate>
	<dc:creator>Luke</dc:creator>
</item>
<item>
	<title>Magnus Therning: Dataenc finally making it into Debian</title>
	<guid isPermalink="false">http://therning.org/magnus/?p=672</guid>
	<link>http://therning.org/magnus/archives/672</link>
	<description>&lt;p&gt;Erik de Castro Lopo is having a lot more success with getting &lt;a href=&quot;http://www.mega-nerd.com/erikd/Blog/CodeHacking/Debian/polyparse_dataenc_json.html&quot;&gt;dataenc into Debian&lt;/a&gt; than I ever had.&lt;/p&gt;
&lt;div class=&quot;bookmarkify&quot;&gt;&lt;a name=&quot;bookmarkify&quot;&gt;&lt;/a&gt;&lt;div class=&quot;linkbuttons&quot;&gt;&lt;a href=&quot;http://digg.com/submit?phase=2&amp;amp;url=http://therning.org/magnus/archives/672&amp;amp;title=Dataenc finally making it into Debian&quot; title=&quot;Digg It!&quot;&gt;&lt;img src=&quot;http://therning.org/magnus/wp-content/plugins/bookmarkify/digg.png&quot; alt=&quot;[Digg] &quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://reddit.com/submit?url=http://therning.org/magnus/archives/672&amp;amp;title=Dataenc finally making it into Debian&quot; title=&quot;Reddit&quot;&gt;&lt;img src=&quot;http://therning.org/magnus/wp-content/plugins/bookmarkify/reddit.png&quot; alt=&quot;[Reddit] &quot; /&gt;&lt;/a&gt;  &lt;a title=&quot;See more bookmark and sharing options...&quot; href=&quot;http://therning.org/magnus/archives/672#bookmarkify&quot; rel=&quot;nofollow&quot;&gt;&lt;small&gt;More&amp;nbsp;&amp;raquo;&lt;/small&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</description>
	<pubDate>Wed, 01 Jul 2009 13:54:59 +0000</pubDate>
	<dc:creator>Magnus</dc:creator>
</item>
<item>
	<title>Thomas ten Cate: New build instructions</title>
	<guid isPermalink="false">http://eclipsefp.wordpress.com/?p=78</guid>
	<link></link>
	<description>Because of many problems I experienced with Darcs, I converted the EclipseFP repository to Git. I really like the clean and simple model and UI of Darcs, and I&amp;#8217;m sorry to see it go, but it was simply too slow and too unreliable. Also, I removed all dependencies on Cohatoe. Without further ado, here are [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=eclipsefp.wordpress.com&amp;amp;blog=7738156&amp;amp;post=78&amp;amp;subd=eclipsefp&amp;amp;ref=&amp;amp;feed=1&quot; /&gt;</description>
	<pubDate>Wed, 01 Jul 2009 10:35:31 +0000</pubDate>
	<dc:creator>Thomas ten Cate</dc:creator>
</item>
<item>
	<title>Erik de Castro Lopo: Three More for the Debian New Queue.</title>
	<guid isPermalink="false">http://www.mega-nerd.com/erikd/Blog/2009/07/01/polyparse_dataenc_json</guid>
	<link>http://www.mega-nerd.com/erikd/Blog/CodeHacking/Debian/polyparse_dataenc_json.html</link>
	<description>&lt;p&gt;
Over the last couple of weeks I've managed to get three new packages into the
Debian NEW queue :
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
	&lt;a href=&quot;http://ftp-master.debian.org/new/haskell-polyparse_1.3-1.html&quot;&gt;
	haskell-polyparse&lt;/a&gt; -
	A variety of alternative parser combinator libraries for Haskell (this is
	a dependency for later versions of HaXml).
	&lt;/li&gt;
&lt;li&gt;
	&lt;a href=&quot;http://ftp-master.debian.org/new/haskell-dataenc_0.13.0.0-1.html&quot;&gt;
	haskell-dataenc&lt;/a&gt; -
	A Haskell library of data encoders and decoders like Base64, uuencoding etc.
	&lt;/li&gt;
&lt;li&gt;
	&lt;a href=&quot;http://ftp-master.debian.org/new/haskell-json_0.4.3-1.html&quot;&gt;
	haskell-json&lt;/a&gt; -
	Haskell library for serialising data to and from JSON.
	&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;/p&gt;

&lt;p&gt;
Thanks to
	&lt;a href=&quot;http://www.vergenet.net/~horms/&quot;&gt;
	Simon Horman&lt;/a&gt;
for sponsoring/uploading the first two of and
	&lt;a href=&quot;http://www.hezmatt.org/~mpalmer/blog/general/&quot;&gt;
	Matt Palmer&lt;/a&gt;
for sponsoring/uploading haskell-json.
&lt;/p&gt;</description>
	<pubDate>Wed, 01 Jul 2009 08:32:00 +0000</pubDate>
</item>
<item>
	<title>Greg Bacon: FFI: calling into kernel32.dll</title>
	<guid isPermalink="false">tag:blogger.com,1999:blog-16846333.post-1132319151631274993</guid>
	<link>http://feedproxy.google.com/~r/gbacon/~3/o-lAJeIoUbk/ffi-calling-into-kernel32dll.html</link>
	<description>Calling the Win32 API function &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms724295%28VS.85,loband%29.aspx&quot;&gt;GetComputerName&lt;/a&gt; makes for a nice demonstration of combining Haskell's &lt;a href=&quot;http://book.realworldhaskell.org/read/interfacing-with-c-the-ffi.html&quot;&gt;FFI&lt;/a&gt;, &lt;a href=&quot;http://www.haskell.org/ghc/docs/latest/html/users_guide/hsc2hs.html&quot;&gt;hsc2hs&lt;/a&gt;, and &lt;a href=&quot;http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/&quot;&gt;Cabal&lt;/a&gt;.
&lt;p&gt;
The front matter:
&lt;pre&gt;&lt;span class=&quot;comment&quot;&gt;{-# LANGUAGE ForeignFunctionInterface #-}&lt;/span&gt;

&lt;span class=&quot;keyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Win32&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Kernel32&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;getComputerName&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt;

&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Control&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Monad&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;when&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;unless&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Bits&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.|.&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Foreign&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Marshal&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Alloc&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;alloca&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Foreign&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Ptr&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;nullPtr&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Foreign&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Storable&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;peek&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;poke&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Win32&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Types&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPDWORD&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPTSTR&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPVOID&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;varid&quot;&gt;peekTStringLen&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;peekTString&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;withTString&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;cpp&quot;&gt;#include &amp;lt;windows.h&amp;gt;&lt;/span&gt;&lt;/pre&gt;
With hsc2hs, it's possible to &lt;tt&gt;#include&lt;/tt&gt; C headers and use constants in Haskell programs, as we'll see below.
&lt;p&gt;
Now to get hold of a few entry points in &lt;tt&gt;kernel32.dll&lt;/tt&gt;. The types defined in &lt;a href=&quot;http://www.haskell.org/ghc/docs/latest/html/libraries/Win32/System-Win32-Types.html&quot;&gt;System.Win32.Types&lt;/a&gt; are handy:
&lt;pre&gt;&lt;span class=&quot;keyword&quot;&gt;foreign&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;stdcall&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;unsafe&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;GetComputerNameW&quot;&lt;/span&gt;
  &lt;span class=&quot;varid&quot;&gt;win32_getComputerName&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPTSTR&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPDWORD&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Bool&lt;/span&gt;

&lt;span class=&quot;keyword&quot;&gt;foreign&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;stdcall&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;unsafe&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;GetLastError&quot;&lt;/span&gt;
  &lt;span class=&quot;varid&quot;&gt;win32_getLastError&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;

&lt;span class=&quot;keyword&quot;&gt;foreign&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;stdcall&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;unsafe&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;FormatMessageW&quot;&lt;/span&gt;
  &lt;span class=&quot;varid&quot;&gt;win32_formatMessage&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPVOID&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPTSTR&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;LPVOID&lt;/span&gt;
                      &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;DWORD&lt;/span&gt;&lt;/pre&gt;
Note the use of the &lt;a href=&quot;http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffise3.html#x6-110003.1&quot;&gt;stdcall calling convention&lt;/a&gt; and that we're calling the wide-character versions.
&lt;p&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms724295%28VS.85,loband%29.aspx&quot;&gt;GetComputerName&lt;/a&gt; takes two parameters, a pointer to a character-buffer and a pointer to an in-out DWORD (in: capacity; out: used). On the Haskell side, this means a couple of allocations, initialize the length parameter, call GetComputerName, and read the result:
&lt;pre&gt;&lt;span class=&quot;definition&quot;&gt;getComputerName&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;String&lt;/span&gt;
&lt;span class=&quot;definition&quot;&gt;getComputerName&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt;
  &lt;span class=&quot;varid&quot;&gt;withTString&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;maxBuf&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt;
    &lt;span class=&quot;keyglyph&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;buf&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;varid&quot;&gt;alloca&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;len&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;do&lt;/span&gt;
        &lt;span class=&quot;varid&quot;&gt;poke&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;len&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;fromIntegral&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;maxLength&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;varid&quot;&gt;success&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;win32_getComputerName&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;buf&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;len&lt;/span&gt;
        &lt;span class=&quot;varid&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;success&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;failWithLastError&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;GetComputerName&quot;&lt;/span&gt;

        &lt;span class=&quot;varid&quot;&gt;len'&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;peek&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;len&lt;/span&gt;
        &lt;span class=&quot;varid&quot;&gt;peekTStringLen&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;fromIntegral&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;len'&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;maxBuf&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;replicate&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;maxLength&lt;/span&gt; &lt;span class=&quot;chr&quot;&gt;'\0'&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;maxLength&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cpp&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;MAX_COMPUTERNAME_LENGTH&lt;/span&gt;&lt;/pre&gt;
The &lt;tt&gt;#const&lt;/tt&gt; bit at the end tells hsc2hs to substitute the value of the C preprocessor symbol &lt;tt&gt;MAX_COMPUTERNAME_LENGTH&lt;/tt&gt;.
&lt;p&gt;
If all goes well, GetComputerName returns non-zero, but we'd like to handle cases when things go wrong. In the Win32 API, we'd call &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms679360%28VS.85,loband%29.aspx&quot;&gt;GetLastError&lt;/a&gt; and convert the error code to a human-readable diagnostic with &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms679351%28VS.85,loband%29.aspx&quot;&gt;FormatMessage&lt;/a&gt;:
&lt;pre&gt;&lt;span class=&quot;definition&quot;&gt;failWithLastError&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;a&lt;/span&gt;
&lt;span class=&quot;definition&quot;&gt;failWithLastError&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;varid&quot;&gt;code&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;win32_getLastError&lt;/span&gt;
  &lt;span class=&quot;varid&quot;&gt;withTString&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;errbuf&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt;
    &lt;span class=&quot;keyglyph&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;buf&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;varid&quot;&gt;gotmsg&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;win32_formatMessage&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;flags&lt;/span&gt;
                                    &lt;span class=&quot;varid&quot;&gt;nullPtr&lt;/span&gt;
                                    &lt;span class=&quot;varid&quot;&gt;code&lt;/span&gt;
                                    &lt;span class=&quot;varid&quot;&gt;lang&lt;/span&gt;
                                    &lt;span class=&quot;varid&quot;&gt;buf&lt;/span&gt;
                                    &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;fromIntegral&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;errlen&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
                                    &lt;span class=&quot;varid&quot;&gt;nullPtr&lt;/span&gt;
      &lt;span class=&quot;varid&quot;&gt;fmtcode&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;win32_getLastError&lt;/span&gt;
      &lt;span class=&quot;varid&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;gotmsg&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;num&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt;
        &lt;span class=&quot;varid&quot;&gt;fail&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; failed: &quot;&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;show&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;fmtcode&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;varid&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;peekTString&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;buf&lt;/span&gt;
      &lt;span class=&quot;varid&quot;&gt;fail&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;: &quot;&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;filter&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;notEOL&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;msg&lt;/span&gt;
  &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;errbuf&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;replicate&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;errlen&lt;/span&gt; &lt;span class=&quot;chr&quot;&gt;'\0'&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;errlen&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;num&quot;&gt;300&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;flags&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cpp&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;FORMAT_MESSAGE_FROM_SYSTEM&lt;/span&gt;
            &lt;span class=&quot;varop&quot;&gt;.|.&lt;/span&gt;
            &lt;span class=&quot;cpp&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;FORMAT_MESSAGE_IGNORE_INSERTS&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;num&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;varid&quot;&gt;notEOL&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;/=&lt;/span&gt; &lt;span class=&quot;chr&quot;&gt;'\n'&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;/=&lt;/span&gt; &lt;span class=&quot;chr&quot;&gt;'\r'&lt;/span&gt;&lt;/pre&gt;
FormatMessage can fail too, so in that case, the poor user is stuck with a couple of opaque error codes. Otherwise, peekTString copies the formatted error message for use with &lt;a href=&quot;http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#v%3Afail&quot;&gt;fail&lt;/a&gt;. Note also that Win32's FormatMessage is &lt;a href=&quot;http://en.wikipedia.org/wiki/Stdarg.h&quot;&gt;variadic&lt;/a&gt;, but this wrapper does not take advantage, instead passing a canned null pointer.
&lt;p&gt;
Having nice error messages can be sort of helpful with programming errors such as forgetting to initialize the length parameter in a call to GetComputerName:
&lt;pre&gt;$ cabal test
test: user error (GetComputerName: The file name is too long.)&lt;/pre&gt;
The code above lives in a file named &lt;tt&gt;Kernel32.hsc&lt;/tt&gt;. The package definition (.cabal file) points to the module name, and when Cabal finds the &lt;tt&gt;.hsc&lt;/tt&gt; extension, it transparently runs the code through hsc2hs:
&lt;pre&gt;Library
  hs-source-dirs:  src
  exposed-modules: Win32.Kernel32
  build-depends:   base, Win32
  extensions:      ForeignFunctionInterface
  ghc-options:     -Wall&lt;/pre&gt;
The package includes &lt;a href=&quot;http://gbacon.blogspot.com/2009/06/setting-up-simple-test-with-cabal.html&quot;&gt;a simple test&lt;/a&gt; that calls getComputerName and prints the result to the standard output, so the following sequence of commands should remind you of your machine's name:
&lt;pre&gt;cabal configure -ftest
cabal build
cabal test&lt;/pre&gt;
The code is also &lt;a href=&quot;http://github.com/gbacon/hs-kernel32/tree/master&quot;&gt;available on GitHub&lt;/a&gt;.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/16846333-1132319151631274993?l=gbacon.blogspot.com&quot; /&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/gbacon/~4/o-lAJeIoUbk&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Tue, 30 Jun 2009 23:57:56 +0000</pubDate>
	<dc:creator>Greg (greg.bacon@gmail.com)</dc:creator>
</item>
<item>
	<title>Ralf Lammel: SYB goes Prolog</title>
	<guid isPermalink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810078</guid>
	<link>http://blogs.msdn.com/ralflammel/archive/2009/06/30/syb-goes-prolog.aspx</link>
	<description>&lt;p&gt;I am about to finish a short article on SYB in Prolog.&lt;/p&gt;&lt;p&gt;Deadline seems to be in 30 hours from now.&lt;/p&gt;&lt;p&gt;If anyone has suggestions, I'd appreciate it.&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Ralf&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.uni-koblenz.de/%7Elaemmel/OdeToProlog/&quot; title=&quot;http://www.uni-koblenz.de/~laemmel/OdeToProlog/&quot;&gt;http://www.uni-koblenz.de/~laemmel/OdeToProlog/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h1&gt;Scrap Your Boilerplate---Prologically!&lt;/h1&gt;

&lt;dl&gt;&lt;dt&gt;&lt;b&gt; Status (30 June 2009) &lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt;
  Paper available in draft form.
  &lt;br /&gt;
  Code distribution not yet available online.
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Author(s)&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; Ralf Lämmel
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Abstract&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt;
  
  ``Scrap Your Boilerplate'' (SYB) is an established style of generic
  functional programming. The present paper reconstructs SYB within
  the Prolog language with the help of the univ operator and
  higher-order logic programming techniques. We pay attention to the
  particularities of Prolog. For instance, we deal with traversal of
  non-ground terms. We also develop an alternative model of SYB-like
  traversal based on metaprogramming. This generative, type-driven
  model is also amenable to type-driven optimization.
  
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Keywords&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt;
Scrap Your Boilerplate, Haskell, Prolog, Stratego.  
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt; Bibtex entry &lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt;
&lt;pre&gt;@inproceedings{OdeToProlog,&lt;br /&gt; author = &quot;Ralf L{\&quot;a}mmel&quot;,&lt;br /&gt; title = &quot;{Scrap Your Boilerplate---Prologically!}&quot;,&lt;br /&gt; booktitle = &quot;Proceedings of the 11th ACM SIGPLAN international conference on Principles and practice of declarative programming&quot;,&lt;br /&gt; publisher = ACM,&lt;br /&gt; year = 2009,&lt;br /&gt; note = &quot;6 pages&quot;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Downloads&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt;
&lt;ul&gt;&lt;li&gt; Draft paper: &lt;a href=&quot;http://www.uni-koblenz.de/%7Elaemmel/OdeToProlog/paper.pdf&quot;&gt;[.pdf]&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;



&lt;/dd&gt;&lt;/dl&gt;

&lt;br /&gt;&lt;img src=&quot;http://blogs.msdn.com/aggbug.aspx?PostID=9810078&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 30 Jun 2009 21:52:00 +0000</pubDate>
	<dc:creator>RalfLammel</dc:creator>
</item>
<item>
	<title>Arch Haskell News: Arch Haskell News: June 30 2009</title>
	<guid isPermalink="false">http://archhaskell.wordpress.com/?p=242</guid>
	<link>http://archhaskell.wordpress.com/2009/06/30/arch-haskell-news-june-30-2009/</link>
	<description>&lt;div class=&quot;snap_preview&quot;&gt;&lt;br /&gt;&lt;p&gt;Another update, since there was a bit of a package backlog.&lt;/p&gt;
&lt;p&gt;Hackage now has &lt;strong&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/stats&quot;&gt;1395&lt;/a&gt; &lt;/strong&gt;(+130)&lt;strong&gt; &lt;/strong&gt;Haskell packages, of which &lt;a href=&quot;http://aur.archlinux.org/packages.php?O=0&amp;amp;L=0&amp;amp;C=0&amp;amp;K=arch-haskell&amp;amp;SeB=m&amp;amp;SB=n&amp;amp;SO=a&amp;amp;PP=100&amp;amp;do_Search=Go&quot;&gt;&lt;strong&gt;1222&lt;/strong&gt;&lt;/a&gt; (+113) (87.6%) have been natively packaged for Arch in AUR.  All these packages are available via AUR, using the &amp;#8220;yaourt&amp;#8221; tool.&lt;/p&gt;
&lt;p&gt;The full log of updates and new packages is &lt;a href=&quot;http://www.galois.com/~dons/arch.june.html&quot;&gt;available here&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Notable Updates&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HDBC&quot;&gt;haskell-hdbc-2.1.1&lt;/a&gt;: Haskell Database Connectivity&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Takusen&quot;&gt;haskell-takusen-0.8.5&lt;/a&gt;: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cpphs&quot;&gt;cpphs-1.7&lt;/a&gt;: A liberalised re-implementation of cpp, the C pre-processor.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Chart&quot;&gt;haskell-chart-0.11&lt;/a&gt;: A library for generating 2D Charts and Plots&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/atom&quot;&gt;haskell-atom-0.0.5&lt;/a&gt;: A DSL for embedded hard realtime applications.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmatrix&quot;&gt;haskell-hmatrix-0.5.2.2&lt;/a&gt;: Linear algebra and numerical computations&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/network&quot;&gt;haskell-network-2.2.1.3&lt;/a&gt;: Networking-related facilities&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hxt&quot;&gt;haskell-hxt-8.3.1&lt;/a&gt;: A collection of tools for processing XML with Haskell.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Dozens of other packages have been added as well. Interestingly, a handful of new Haskell games have been published.&lt;/p&gt;
  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/archhaskell.wordpress.com/242/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/archhaskell.wordpress.com/242/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/archhaskell.wordpress.com/242/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/archhaskell.wordpress.com/242/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/archhaskell.wordpress.com/242/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/archhaskell.wordpress.com/242/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/archhaskell.wordpress.com/242/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/archhaskell.wordpress.com/242/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/archhaskell.wordpress.com/242/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/archhaskell.wordpress.com/242/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=archhaskell.wordpress.com&amp;amp;blog=4844076&amp;amp;post=242&amp;amp;subd=archhaskell&amp;amp;ref=&amp;amp;feed=1&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 30 Jun 2009 21:25:23 +0000</pubDate>
	<dc:creator>dons00</dc:creator>
</item>
<item>
	<title>Galois, Inc: Tech Talk: The Fleet Architecture</title>
	<guid isPermalink="false">http://www.galois.com/blog/?p=887</guid>
	<link>http://www.galois.com/blog/2009/06/30/fleet/</link>
	<description>&lt;p&gt;The July 7th Galois Tech Talk  will be delivered by Ivan Sutherland, titled &lt;strong&gt;“The Fleet Architecture”&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Date: Tuesday, July 7th, 2009&lt;/li&gt;
&lt;li&gt;Time: 10:30am - 11:30am&lt;/li&gt;
&lt;li&gt; Location: Galois, Inc.&lt;br /&gt;
421 SW 6th Ave. Suite 300&lt;br /&gt;
(3rd floor of the Commonwealth Building)&lt;br /&gt;
Portland, OR 97204&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;: This talk describes a radically different architecture for computing called Fleet. Fleet accepts the limitations to computing imposed by physics: moving data around inside a computer costs more energy, more delay, and more chip area than the arithmetic and logical operations ordinarily called &amp;#8220;computing.&amp;#8221; Fleet puts the programmer firmly in charge of the most costly resource, communication, instead of in charge of the arithmetic and logical resources that are now almost free. Fleet treats arithmetic and logical operations as side effects of where the programmer sends data.&lt;/p&gt;
&lt;p&gt;Fleet achieves high performance through fine grain concurrency. Everything Fleet does is concurrent at the lowest level; programmers who wish sequentiality must program it explicitly. Fleet presents a stark contrast to today&amp;#8217;s multi-core machines in which programmers seek concurrency in an inherently sequential environment.&lt;/p&gt;
&lt;p&gt;The Fleet architecture uses a uniform switch fabric to simplify chip design. A few thousand identical copies of a programmable interface connect a thousand or so repetitions of basic arithmetic, logical, input-output, and storage units to the switch fabric. The uniform switch fabric and its identical programmable interfaces replace many of the hard parts of designing the computing elements themselves.&lt;/p&gt;
&lt;p&gt;Both software and FPGA simulators of a Fleet system are available at UC Berkeley. Berkeley students have written a variety of Fleet programs; their work helped to define what the programmable interface between computing and communication must do. A simple compiler now produces the programs required at source and destination to provide flow-controlled communication. We expect work on a higher-level language to appear soon as a PhD dissertation.&lt;/p&gt;
&lt;p&gt;A recent 90 nanometer TSMC test chip, called Infinity, demonstrated switch fabric performance at about 4 GHz. A new test chip, called Marina, has just gone out for fabrication. Marina will test the programmable interface, and if successful, will give us confidence to build a complete Fleet. We seek participation from sponsors, programmers, and designers of basic computation elements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bio&lt;/strong&gt;: Ivan Sutherland is a Visiting Scientist at Portland State University where he and Marly Roncken have recently established the &amp;#8220;Asynchronous Research Center&amp;#8221; (ARC). The ARC occupies both physical and intellectual space half way between the Computer Science (CS) and Electrical and Computer Engineering (ECE) departments at the university. The ARC seeks to free designers from the tyranny of the clock by developing better tools and teaching methods for design of self-timed systems. Prior to moving to Portland, Ivan spent 25 years as a Fellow and Vice President at Sun Microsystems. A graduate of Carnegie Tech, Ivan got his PhD at MIT in 1963 and has taught at Harvard, University of Utah, and Caltech.&lt;/p&gt;
&lt;p&gt;Dr. Sutherland received the &lt;a href=&quot;http://awards.acm.org/citation.cfm?id=8840562&amp;amp;srt=all&amp;amp;aw=140&amp;amp;ao=AMTURING&quot;&gt;1998 Turing Award&lt;/a&gt;, for his pioneering work in the field of computer graphics.&lt;/p&gt;
&lt;hr /&gt;&lt;a href=&quot;http://galois.com/&quot;&gt;Galois&lt;/a&gt; has been holding weekly technical seminars for several years on topics from functional programming, formal methods, compiler and language design, to cryptography, and operating system construction, with talks by many figures from the programming language and formal methods communities. The talks are open and free. An RSVP is not required, but feel free to contact the &lt;a href=&quot;mailto:levent.erkok@galois.com&quot;&gt;organizer&lt;/a&gt; with questions and comments.</description>
	<pubDate>Tue, 30 Jun 2009 20:23:09 +0000</pubDate>
	<dc:creator>Levent Erkok</dc:creator>
</item>
<item>
	<title>Greg Bacon: Setting up a simple test with Cabal</title>
	<guid isPermalink="false">tag:blogger.com,1999:blog-16846333.post-5569574088927553184</guid>
	<link>http://feedproxy.google.com/~r/gbacon/~3/7rlf4Dd1JKU/setting-up-simple-test-with-cabal.html</link>
	<description>With the &lt;a href=&quot;http://www.haskell.org/cabal/&quot;&gt;Cabal&lt;/a&gt; build and packaging system for Haskell, add a simple test program to your build with a couple of easy steps.
&lt;p&gt;
First, add the following to your project's cabal file:
&lt;pre&gt;Build-Type: Custom

...

flag test
  description: Build test program.
  default:     False

Executable test
  hs-source-dirs:  src, test
  other-modules:   MyModule1, MyModule2
  main-is:         Main.hs
  build-depends:   base
  if !flag(test)
    buildable:     False&lt;/pre&gt;
When enabled (via &lt;tt&gt;cabal configure -ftest&lt;/tt&gt; but otherwise off), this builds an extra program called &lt;tt&gt;test&lt;/tt&gt;.
&lt;p&gt;
The custom build type gives you more flexibility in your setup script, so add code such as the following to &lt;tt&gt;Setup.hs&lt;/tt&gt;:
&lt;pre&gt;main = defaultMainWithHooks hooks
  where hooks = simpleUserHooks { runTests = runTests' }

runTests' :: Args -&gt; Bool -&gt; PackageDescription -&gt; LocalBuildInfo -&gt; IO ()
runTests' _ _ _ lbi = system testprog &gt;&gt; return ()
  where testprog = (buildDir lbi) &amp;lt;/&gt; &quot;test&quot; &amp;lt;/&gt; &quot;test&quot;&lt;/pre&gt;
When you run &lt;tt&gt;cabal test&lt;/tt&gt;, it will kick off your test program whose source is in &lt;tt&gt;test/Main.hs&lt;/tt&gt;.
&lt;p&gt;
This approach has a few drawbacks. Users must explicitly enable the test builds. Building the test program entails &lt;em&gt;rebuilding&lt;/em&gt; the other libraries in your package. Installing from a &lt;tt&gt;-ftest&lt;/tt&gt; configuration will also install your test program.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/16846333-5569574088927553184?l=gbacon.blogspot.com&quot; /&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/gbacon/~4/7rlf4Dd1JKU&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Tue, 30 Jun 2009 13:57:44 +0000</pubDate>
	<dc:creator>Greg (greg.bacon@gmail.com)</dc:creator>
</item>
<item>
	<title>Philip Wadler: Pictures created from food</title>
	<guid isPermalink="false">tag:blogger.com,1999:blog-9757377.post-614784162609039449</guid>
	<link>http://wadler.blogspot.com/2009/06/pictures-created-from-food.html</link>
	<description>&lt;a href=&quot;http://blogofsorts.files.wordpress.com/2008/04/image004.jpg&quot;&gt;&lt;img src=&quot;http://blogofsorts.files.wordpress.com/2008/04/image004.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Spotted by Robby Findler.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/9757377-614784162609039449?l=wadler.blogspot.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 30 Jun 2009 13:13:14 +0000</pubDate>
	<dc:creator>Philip Wadler (noreply@blogger.com)</dc:creator>
</item>
<item>
	<title>Ketil Malde: Dephd updates</title>
	<guid isPermalink="false">http://blog.malde.org/index.php/2009/06/16/dephd-updates/</guid>
	<link>http://blog.malde.org/index.php/2009/06/16/dephd-updates/</link>
	<description>&lt;p&gt;Dephd is a small application for performing various analysis of nucleotide sequences.  Originally, it was used for analyzing/converting PHD-file output from the &lt;a href=&quot;http://en.wikipedia.org/wiki/Phred_base_calling&quot; title=&quot;Phred base calling on Wikipedia&quot;&gt;basecaller &lt;tt&gt;phred&lt;/tt&gt;&lt;/a&gt;, but it has since grown a bit beyond that.  A new update was just pushed onto &lt;a href=&quot;http://hackage.haskell.org/package/dephd&quot; title=&quot;dephd on Hackage&quot;&gt;HackageDB&lt;/a&gt;, this is just a quick note describing new features.&lt;/p&gt;</description>
	<pubDate>Tue, 30 Jun 2009 11:41:59 +0000</pubDate>
	<dc:creator>ketil</dc:creator>
</item>
<item>
	<title>Bryan O'Sullivan: What&amp;#8217;s in a text API?</title>
	<guid isPermalink="false">http://www.serpentine.com/blog/?p=397</guid>
	<link>http://www.serpentine.com/blog/2009/06/30/python-and-haskell-text-apis-compare/</link>
	<description>&lt;p&gt;Now that I&amp;#8217;ve got the &lt;a href=&quot;http://www.defun2009.info/blog/tutorial-schedule/&quot;&gt;DEFUN 2009 schedule&lt;/a&gt; sorted out (you &lt;i&gt;are&lt;/i&gt; coming, aren&amp;#8217;t you?), I&amp;#8217;ve had time to take a breath and think about the &lt;a href=&quot;http://hackage.haskell.org/package/text&quot;&gt;Haskell text library&lt;/a&gt; again. Its API is currently a clone of the ancient and venerable Haskell list API. If you&amp;#8217;ve used the list API to do much text processing, you&amp;#8217;ve probably spilled more than a few tears into your whiskey. The &lt;a href=&quot;http://hackage.haskell.org/package/bytestring&quot;&gt;bytestring library&lt;/a&gt; also mostly clones the list API, albeit with a few improvements. This state of affairs makes me somewhat sad: here we are with a fabulous language, but a 1991-era API for mangling text.&lt;/p&gt;

&lt;p&gt;To put this state of affairs into perspective, here is a function-by-function comparison of the string manipulation APIs of Python 2.6 and Haskell. This is intentionally somewhat pessimistic: I focus on aspects of the Python API that are either absent from or not trivially reimplemented in Haskell, but not the reverse. (If the details that follow make your eyes glaze over, skip them and &lt;a href=&quot;http://www.serpentine.com/blog/2009/06/30/python-and-haskell-text-apis-compare/#continue&quot;&gt;read on after the table&lt;/a&gt; below.)&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Python&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Haskell&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x + y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x `append` y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x in y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x `isInfixOf` y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x &amp;lt; y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x &amp;lt; y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x &amp;lt;= y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x &amp;lt;= y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x == y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x == y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x != y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x /= y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x &amp;gt; y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x &amp;gt; y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x &amp;gt;= y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x &amp;gt;= y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x % (...)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x[i] &lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;x `index` i&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x[i:j]&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;(j-i) `take` (i `drop` x)&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;hash(x)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;len(x)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;length x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x * y&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;y `replicate` x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.capitalize()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.center(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.count()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.decode()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;decode...&lt;/tt&gt; family&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.encode()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;encode...&lt;/tt&gt; family&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.endswith(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;y `isSuffixOf` x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.expandtabs()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.find(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.format(...)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.index(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.isalnum()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;all isAlphaNum x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.isalpha()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;all isAlpha x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.isdigit()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;all isDigit x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.islower()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;all isLower x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.isspace()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;all isSpace x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.istitle()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.isupper()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;all isUpper x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.join(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;intercalate x y&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.ljust(w)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.lower()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;toLower x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.lstrip()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;dropWhile isSpace&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.partition(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;break (==y) x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.replace(y,z)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.rfind(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.rindex(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.rjust(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.rpartition(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.rsplit(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.rstrip(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.split(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.splitlines()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;lines x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.startswith(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;y `isPrefixOf` x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.strip()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.swapcase()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.title()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.translate(y)&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.upper()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;toUpper x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;tt&gt;x.zfill()&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;tt&gt;&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;a name=&quot;continue&quot;&gt;
&lt;p&gt;For now, I&amp;#8217;m intentionally not looking at Python&amp;#8217;s &lt;a href=&quot;http://docs.python.org/library/unicodedata.html&quot;&gt;&lt;tt&gt;unicodedata&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;http://docs.python.org/library/string.html&quot;&gt;&lt;tt&gt;string&lt;/tt&gt;&lt;/a&gt; packages, even though each contains a handful of additional useful functions.&lt;/p&gt;

&lt;p&gt;How would I broadly categorise what&amp;#8217;s missing from the current Haskell APIs?&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Formatting. The &lt;a href=&quot;http://docs.python.org/library/string.html#formatstrings&quot;&gt;&lt;tt&gt;format&lt;/tt&gt;&lt;/a&gt; method that&amp;#8217;s new in Python 2.6 is well designed and extremely useful. While there are a few formatting libraries on Hackage, each has flaws which I think are substantial enough to make them undesirable for wide use. As examples of those shortcomings, I&amp;#8217;m thinking of a lack of static type safety or a poor fit for automated translation tools.&lt;/li&gt;
	&lt;li&gt;Searching and splitting text. The Haskell APIs are based on predicates over individual characters, whereas what&amp;#8217;s usually needed is predicates over &lt;i&gt;strings&lt;/i&gt;. In other words, don&amp;#8217;t just find me a character; find me a substring.&lt;/li&gt;
	&lt;li&gt;Parsing. I&amp;#8217;m not overly concerned about this, since Haskell&amp;#8217;s libraries far outshine those of Python in this area. Although they currently lack support for the text library, the &lt;a href=&quot;http://hackage.haskell.org/package/parsec&quot;&gt;Parsec&lt;/a&gt; and &lt;a href=&quot;http://hackage.haskell.org/package/attoparsec&quot;&gt;attoparsec&lt;/a&gt; libraries will acquire it, I&amp;#8217;m sure, as soon as there&amp;#8217;s demand. What &lt;em&gt;would&lt;/em&gt; be welcome is a decent Unicode-capable regular expression engine, for those times when you just &lt;em&gt;have&lt;/em&gt; to get yourself into trouble in the name of expediency.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I intend to address each of these areas over the coming months, and I&amp;#8217;ll write up the APIs I intend to flesh out here before I actually implement them, to solicit feedback from the community. One step that I think I&amp;#8217;ll probably take, for instance, is to move a few of the functions in the &lt;tt&gt;Data.Text&lt;/tt&gt; module that clone the list API into a new module, &lt;tt&gt;Data.Text.Legacy&lt;/tt&gt;, so that I can use the same function names in &lt;tt&gt;Data.Text&lt;/tt&gt;, but with more useful types. As an example of what I have in mind, I&amp;#8217;d be inclined to move &lt;tt&gt;split :: Char -&amp;gt; Text -&amp;gt; [Text]&lt;/tt&gt; into the legacy module, and replace it with &lt;tt&gt;split :: Text -&amp;gt; Text -&amp;gt; [Text]&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;There&amp;#8217;s something of a tension between the goals of providing a small, focused text library and getting all the API details right in a way that will make it truly useful. I find the proliferation of tiny libraries on Hackage, each providing a few little pieces of missing functionality, to be pretty dispiriting from the point of view of getting dug in and producing useful application code quickly, so I intend for the text and &lt;a href=&quot;http://hackage.haskell.org/package/text-icu&quot;&gt;text-icu&lt;/a&gt; libraries to be broadly useful from the get-go.&lt;/p&gt;

&lt;p&gt;If you have opinions, or better yet patches, to contribute, let&amp;#8217;s get things rolling!&lt;/p&gt;&lt;/a&gt;</description>
	<pubDate>Tue, 30 Jun 2009 06:13:18 +0000</pubDate>
	<dc:creator>Bryan O'Sullivan (bos@serpentine.com)</dc:creator>
</item>
<item>
	<title>Tom Moertel: Dear Jeff Bezos:  Here's an easy, effective way to fix the production problems in Amazon Kindle-edition books and, at the same time, prove that the Kindle is really, truly better than paper</title>
	<guid isPermalink="false">urn:uuid:c47c8445-30ba-494d-95e4-cddc3d6f9eb2</guid>
	<link>http://blog.moertel.com/articles/2009/06/29/dear-jeff-bezos-heres-and-easy-way-to-fix-kindle-edition-books</link>
	<description>&lt;p&gt;I recently purchased a Kindle DX, mainly to read &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; documents that contain math and comp-sci formulas.  Still, I couldn&amp;#8217;t resist the temptation to try out the instant gratification of purchasing a &amp;#8220;Kindle edition&amp;#8221; ebook, so I ordered a sci-fi novel I had read as a child, Alan Dean Foster&amp;#8217;s &lt;a href=&quot;http://www.amazon.com/gp/product/B000FBFOJQ?ie=UTF8&amp;#38;tag=tommoertesweb-20&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;creativeASIN=B000FBFOJQ&quot;&gt;The Tar-aiym Krang&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;The Good&lt;/h3&gt;


	&lt;p&gt;The purchase and download via the ever-so-branded &amp;#8220;Whispernet&amp;#8221; wireless network went without a hitch.  The Kindle DX, itself, was great and made reading easy.  The text looked good, the navigation seemed intuitive.  There was just one problem.&lt;/p&gt;


	&lt;h3&gt;The Bad&lt;/h3&gt;


	&lt;p&gt;The production standards of the content destroyed any chance of convincing me that I was reading something akin to a real book.  I found numerous typographical errors, something that just doesn&amp;#8217;t occur in real mass-market books, which have been subjected to professional review after typesetting.  By far, the most common error was the substitution of a left open single quote for what should have been an apostrophe, an error that I don&amp;#8217;t think Amazon missed an opportunity to make.  For example, when shortening &lt;em&gt;computer&lt;/em&gt; to &lt;em&gt;’puter&lt;/em&gt;:&lt;/p&gt;


&lt;div class=&quot;photo&quot;&gt;&lt;img src=&quot;http://community.moertel.com/~thor/blog/pix-20090629/tak.png&quot; title=&quot;Dear Amazon: that's not an apostrophe&quot; alt=&quot;Dear Amazon: that's not an apostrophe&quot; /&gt;&lt;/div&gt;

	&lt;h3&gt;The brilliant fix (no need to thank me, Mr. Bezos)&lt;/h3&gt;


	&lt;p&gt;So, if you&amp;#8217;re Jeff Bezos, you&amp;#8217;re probably wondering what you can do to improve the quality of Kindle edition books.  After all, you spent all that time, effort, and money on the Kindle itself, getting the look and feel just right, crafting the perfect book-reading experience, even insisting upon seamless &amp;#8220;Whispernet&amp;#8221; downloads to encourage impulse purchases of Kindle editions.  You certainly wouldn&amp;#8217;t want the &lt;em&gt;content owners&lt;/em&gt;, the lovely folks who supply you with typo-ridden source documents, to undo all that you have worked so hard to achieve with the Kindle, to destroy the immersive, luxurious reading experience that you are &lt;em&gt;so close&lt;/em&gt; to delivering, to unweave the spell that convinces readers that the Kindle is just as good as &amp;#8211; if not better than! &amp;#8211; a real book. Somehow, you must fix the content problem, but you know, you just know, the content owners are going to screw it up for you.&lt;/p&gt;


	&lt;p&gt;So, here&amp;#8217;s what you do, Jeff.  Let the content owners screw it up &amp;#8211; you know that&amp;#8217;s what they&amp;#8217;re going to do, anyway &amp;#8211; and fix the errors yourself.  How?  With an army of focused, motivated proofreaders: your customers!&lt;/p&gt;


	&lt;p&gt;Seriously, this idea would work miracles for you, Jeff.  You know how the Kindle lets you make annotations to the Kindle editions you read? Just extend those annotations to include corrections.  Then when those annotations are saved to Amazon&amp;#8217;s servers, extract the corrections, combine them with the corrections from other readers, maybe verify them with a quick third-party review (a perfect job for the Mechanical Turk, wouldn&amp;#8217;t you say?), and then automagically distribute the relevant, approved corrections to every Kindle reader who could benefit from them.  Further, to make your readers happy that they found mistakes in the Kindle editions that they purchased, offer them a bounty, say 25 cents, for the first report of each correction found.&lt;/p&gt;


	&lt;p&gt;In one fell swoop, all your problems with production quality are fixed:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;customers who find errors are no longer angry but happy&lt;/li&gt;
		&lt;li&gt;most Kindle editions will be corrected quickly, ensuring a blemish-free reading experience for the bulk of your customers&lt;/li&gt;
		&lt;li&gt;even if the content owners give you garbage for source documents, and even if they won&amp;#8217;t allow you to change those documents one iota (they are pretty controlling, after all), you can still deliver perfection to your customers: apply corrections on the &amp;#8220;client side,&amp;#8221; correcting the pristine, yet error-filled source material, on the fly, right in the Kindle itself&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;And there&amp;#8217;s one big bonus I didn&amp;#8217;t mention.  &lt;em&gt;This&lt;/em&gt; capability would make Kindle editions &lt;em&gt;better&lt;/em&gt; than real books.  Not just marketing-copy, in-theory better, but really better. As in, now we have a compelling reason to switch from paper:  to get the benefits of &lt;em&gt;collaborative, peer-augmented reading and correction&lt;/em&gt;, in which &lt;em&gt;each&lt;/em&gt; reader&amp;#8217;s contributions enrich the reading experience for &lt;em&gt;all&lt;/em&gt; who follow.  Think about it, Jeff, it&amp;#8217;s a big deal.&lt;/p&gt;


	&lt;p&gt;No need to thank me.&lt;/p&gt;</description>
	<pubDate>Tue, 30 Jun 2009 04:28:35 +0000</pubDate>
	<dc:creator>Tom Moertel</dc:creator>
</item>
<item>
	<title>DEFUN 2009: DEFUN and CUFP 2009 registration are now open!</title>
	<guid isPermalink="false">http://www.defun2009.info/blog/?p=134</guid>
	<link>http://www.defun2009.info/blog/2009/06/defun-2009-registration-is-now-open/</link>
	<description>&lt;p&gt;I&amp;#8217;m pleased to announce that registration for DEFUN 2009 is now open, along with ICFP and associated workshops. For general information, you can see the &lt;a href=&quot;http://www.regmaster.com/conf/icfp2009.html&quot;&gt;ICFP registration page&lt;/a&gt;, and then step through to the &lt;a href=&quot;https://regmaster2.com/cgi-bin/ICF09/on1/RMSs.cgi&quot;&gt;online registration form&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;People who register prior to July 30 will see a significant reduction in prices, which range from US$100 per day for students to $190 for people who are not ACM members. Do take note that if you want to attend both days of DEFUN, you must register for each one separately.&lt;/p&gt;
&lt;p&gt;Also, if you&amp;#8217;re planning to attend DEFUN, I strongly encourage you to sign up for our sister workshop, &lt;a href=&quot;http://cufp.galois.com/2009/schedule.html&quot;&gt;CUFP 2009&lt;/a&gt;, the best place to learn how real world developers are using functional programming in industry.&lt;/p&gt;</description>
	<pubDate>Tue, 30 Jun 2009 04:19:40 +0000</pubDate>
	<dc:creator>admin</dc:creator>
</item>
<item>
	<title>Brent Yorgey: 2009 ICFP programming contest reflections</title>
	<guid isPermalink="false">http://byorgey.wordpress.com/?p=162</guid>
	<link>http://byorgey.wordpress.com/2009/06/29/2009-icfp-programming-contest-reflections/</link>
	<description>&lt;div class=&quot;snap_preview&quot;&gt;&lt;br /&gt;&lt;p&gt;This year, unlike &lt;a href=&quot;http://byorgey.wordpress.com/2008/07/15/icfp-programming-contest-reflections/&quot;&gt;last year&lt;/a&gt;, I had the good fortune to be physically located in the same place as several other people interested in competing in the &lt;a href=&quot;http://icfpcontest.org/&quot;&gt;2009 ICFP Programming Contest&lt;/a&gt;.  We only ended up with three people&amp;#8212;we could have used more&amp;#8212;but it was quite a lot of fun.&lt;/p&gt;
&lt;p&gt;The problem this year (controlling some satellites to accomplish certain goals) was a good one.  I especially liked the approach of distributing binaries to be run on a virtual machine, and requiring execution traces as submissions&amp;#8212;as opposed to last year&amp;#8217;s contest, it removed all the ickiness with wrangling execution platforms and ensuring your code would run on the organizers&amp;#8217; servers.  And the problem itself was nifty, easy to get started on, difficult to finish, and always left room for improvements.  My only complaint is that I would have been more excited about something with a more discrete flavor, since this was the second contest in a row with a simulation of physical objects, vector math, trig, and so on&amp;#8212;but that&amp;#8217;s only a small complaint.  We did respectably, solving 8 of the 16 scenarios (100x and 200x)&amp;#8212;although of course hindsight is 20/20, and I think in particular we could have pretty easily solved all the 300x scenarios.  We ended up spending too much time trying to work things out mathematically and not enough just doing simulation and search (although I&amp;#8217;m definitely biased since I&amp;#8217;m the one who wrote a physics simulator module&amp;#8230; =).&lt;/p&gt;
&lt;p&gt;We used Haskell, of course, which seemed to mostly work well.  I wrote our VM, and although it wasn&amp;#8217;t blazing fast, it was fast enough for what we ended up doing with it. The only truly annoying part was serializing and deserializing IEEE doubles, since Data.Binary doesn&amp;#8217;t use IEEE format, and I didn&amp;#8217;t know about the data-binary-ieee754 package until too late.  I ended up doing some ugliness involving ByteStrings, foreign pointers, peek and poke&amp;#8230; yuck!&lt;/p&gt;
&lt;p&gt;The first scenario was easy enough, using the provided information about Hohmann transfer orbits and looking up some math on computing the required vectors (my teammate Julien did most of the heavy lifting mathematics-research-wise&amp;#8230; I just typed what he told me to =).  For the second scenario, we were able to figure out how to compute the correct angle at which to initiate a Hohmann transfer in order to meet up with the second satellite, but the problem at first was that it wasn&amp;#8217;t accurate enough&amp;#8212;but we finally got it to work doing some simple searches with a physics simulator (after I spent two hours figuring out that negating an angle is NOT the same thing as adding pi to it!).  I&amp;#8217;m confident we could have gotten the third scenario to work similarly, by first transferring to a circular orbit tangent to an apogee of the target orbit (doing some sort of calculation/simulation to work out the timing correctly), but oh well, we didn&amp;#8217;t get there.  This is also where having more people would have helped, both to be able to code more stuff in parallel and for some fresh ideas.&lt;/p&gt;
&lt;p&gt;But, all in all, a most enjoyable experience, and I look forward to putting together a (hopefully larger) team again next summer!&lt;/p&gt;
  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/byorgey.wordpress.com/162/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/byorgey.wordpress.com/162/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/byorgey.wordpress.com/162/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/byorgey.wordpress.com/162/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/byorgey.wordpress.com/162/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/byorgey.wordpress.com/162/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/byorgey.wordpress.com/162/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/byorgey.wordpress.com/162/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/byorgey.wordpress.com/162/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/byorgey.wordpress.com/162/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=byorgey.wordpress.com&amp;amp;blog=1152889&amp;amp;post=162&amp;amp;subd=byorgey&amp;amp;ref=&amp;amp;feed=1&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 29 Jun 2009 21:41:20 +0000</pubDate>
	<dc:creator>Brent</dc:creator>
</item>
<item>
	<title>Haskell Weekly News: Haskell Weekly News: June 29, 2009</title>
	<guid isPermalink="false">http://sequence.complete.org/435 at http://sequence.complete.org</guid>
	<link>http://sequence.complete.org/hwn/20090629</link>
	<description>Haskell Weekly News: June 29, 2009
&lt;p&gt;Welcome to issue 123 of HWN, a newsletter covering
   developments in the &lt;a href=&quot;http://haskell.org/&quot;&gt;Haskell&lt;/a&gt; community.&lt;/p&gt;
&lt;p&gt;A bit late this week since over the weekend I was trying to get some unruly
satellites to behave (with moderate success).  Anyway, some fun stuff this
week: Haskell on the iPhone; new libraries for 3D animation, web development,
session types; new releases of haskell-src-exts and darcs; and more.  Also,
if it seems that there haven't been many quotes lately, it's because people
haven't been @remembering very many in #haskell.  I cannot telepathically
sense (via the Haskell-force, hereafter known as the &quot;Horce&quot;) when someone
says something funny.&lt;/p&gt; &lt;h4&gt;Announcements&lt;/h4&gt; &lt;p&gt;&lt;em&gt;Haskell Symposium
call for participation&lt;/em&gt;. Stephanie Weirich
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/17320&quot;&gt;announced&lt;/a&gt;
   that &lt;a href=&quot;http://www.regmaster.com/conf/icfp2009.html&quot;&gt;registration
   is now open&lt;/a&gt; for the &lt;a href=&quot;http://haskell.org/haskell-symposium/2009/&quot;&gt;ACM SIGPLAN Haskell
   Symposium 2009&lt;/a&gt;, to be held on 3 September 2009 in Edinburgh, Scotland
   (co-located with ICFP). The purpose of the Haskell Symposium is to discuss
   experiences with Haskell and future developments for the language. The
   scope of the symposium includes all aspects of the design, semantics,
   theory, application, implementation, and teaching of Haskell.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;jhc 0.6.1&lt;/em&gt;. John Meacham
   &lt;a href=&quot;http://www.haskell.org//pipermail/haskell/2009-June/021449.html&quot;&gt;announced&lt;/a&gt;
   the release of &lt;a href=&quot;http://repetae.net/computer/jhc/&quot;&gt;jhc 0.6.1&lt;/a&gt;,
   featuring a a much simplified
cross-compilation mechanism.&lt;/p&gt; &lt;p&gt;&lt;em&gt;X Haskell Bindings 0.3&lt;/em&gt;. Antoine
Latter
   &lt;a href=&quot;http://www.haskell.org//pipermail/haskell/2009-June/021460.html&quot;&gt;announced&lt;/a&gt;
   the 0.3.* series release of the &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xhb&quot;&gt;X
   Haskell Bindings&lt;/a&gt;. This release, like the prior 0.2.* series focuses
   on making
the API prettier.&lt;/p&gt; &lt;p&gt;&lt;em&gt;happstack-0.3.2&lt;/em&gt;. Matthew Elder
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/17317&quot;&gt;announced&lt;/a&gt;
   the release of &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/happstack&quot;&gt;happstack-0.3.2&lt;/a&gt;,
   with many changes, updates, and bug fixes.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;sendfile-0.1&lt;/em&gt;. Matthew Elder
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/17316&quot;&gt;announced&lt;/a&gt;
   the release of &lt;a href=&quot;http://hackage.haskell.org/package/sendfile&quot;&gt;sendfile&lt;/a&gt;, a library
   which exposes zero-copy sendfile functionality in a portable way. Right
   now it natively supports linux 2.6+ (maybe older too) and windows 2000+;
   on other platforms it will fall back seamlessly to a portable haskell
   implementation.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Reusable Corecursive Queues via Continuations&lt;/em&gt;. Leon Smith
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/17311&quot;&gt;requested&lt;/a&gt;
   feedback on a draft of an upcoming article in Monad.Reader
   issue 14, &quot;Lloyd Allison's Corecursive Queues: Why
   Continuations Matter&quot;, describing the implementation of the &lt;a href=&quot;http://hackage.haskell.org/package/control-monad-queue&quot;&gt;control-monad-queue&lt;/a&gt;
   package.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Haskell on the iPhone&lt;/em&gt;. Ryan Trinkle
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/17307&quot;&gt;announced&lt;/a&gt;
   that his company, iPwn Studios Inc., is currently preparing to release
   an open source patch to GHC that allows it to output binaries for iPhone
   OS. The patch will be released under a BSD license as soon as possible
   and hopefully integrated into the GHC main-line in the near future.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Program to set the GNOME desktop background picture randomly&lt;/em&gt;. Colin
Paul Adams
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.general/17304&quot;&gt;announced&lt;/a&gt;
   &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/gnome%2Ddesktop&quot;&gt;gnome-desktop&lt;/a&gt;,
   a library which periodically picks a random picture from $HOME/Pictures,
   and sets it as the GNOME desktop background.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;loli: a minimal web dev DSL&lt;/em&gt;. Jinjing Wang
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60675&quot;&gt;announced&lt;/a&gt;
   the release of &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/loli&quot;&gt;loli&lt;/a&gt;,
   a web development DSL built on top of &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hack&quot;&gt;hack&lt;/a&gt;.
   It allows you to easily define routes, build your custom template
   backends through a simple Template interface, and integrate with other
   hack middleware.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Cal3D animation library&lt;/em&gt;. Gregory D. Weber
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60596&quot;&gt;announced&lt;/a&gt;
   the &lt;a href=&quot;http://haskell.org/haskellwiki/Cal3d_animation&quot;&gt;Cal3D
   for Haskell project&lt;/a&gt;, which provides a partial binding to the &lt;a href=&quot;http://home.gna.org/cal3d/&quot;&gt;C++ Cal3D animation library&lt;/a&gt;, a
   platform- and graphics-API-independent C++ library for skeletal-based
   character animation. There are three packages available on hackage: &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cal3d&quot;&gt;cal3d-0.1&lt;/a&gt;,
   a Haskell binding to the Cal3D library itself; as well as &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cal3d%2Dopengl&quot;&gt;cal3d-opengl-0.1&lt;/a&gt;
   and &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cal3d%2Dexamples&quot;&gt;cal3d-examples-0.1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A Reader Monad Tutorial&lt;/em&gt;. Henry Laxen
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60591&quot;&gt;announced&lt;/a&gt;
   a nice &lt;a href=&quot;http://www.maztravel.com/haskell/readerMonad.html&quot;&gt;Reader
   monad tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;full-sessions: yet another implementation of session types&lt;/em&gt;. Keigo
Imai
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60511&quot;&gt;announced&lt;/a&gt;
   the pre-release of &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/full%2Dsessions&quot;&gt;full-sessions&lt;/a&gt;,
   yet another implementation of session types in Haskell. Session
   types are used to statically check the safe and consistent use of
   communication channels according to protocols. A notable advantage of &lt;a href=&quot;http://www.agusa.i.is.nagoya-u.ac.jp/person/sydney/full-sessions.html&quot;&gt;this
   implementation&lt;/a&gt; is that it requires almost no type annotation or term
   annotations. and at the same time provides full functionality of session
   types including channel-generation and channel-passing.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;darcs 2.3 beta 1&lt;/em&gt;. Petr Rockai
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60465&quot;&gt;announced&lt;/a&gt;
   the immediate availability of a first beta release of darcs 2.3. There
   are a number of improvements and bugfixes over the last stable release,
   2.2 (see the announcement for a full list). Moreover, work has been
   done on performance of &quot;darcs whatsnew&quot; for large repositories. This
   has also introduced a slight risk of regressions, but please note
   that all of the disruptive changes are in read-only code paths: the
   new code will never touch your repository, so it is unable to cause
   permanent harm. The worst that could happen is that you get no or
   bad diff from &quot;darcs whatsnew&quot;. Please help test it (cabal install &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/darcs%2Dbeta&quot;&gt;darcs-beta&lt;/a&gt;)!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;New release of ZeroTH&lt;/em&gt;. Robin Green
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60430&quot;&gt;announced&lt;/a&gt;
   a new release (2009.6.23.3) of &lt;a href=&quot;http://hackage.haskell.org/package/zeroth&quot;&gt;ZeroTH&lt;/a&gt;, a tool for
   preprocessing Haskell code to run splices and remove Template Haskell
   dependencies. Major changes include support for more Haskell code via
   haskell-src-exts 1.0.0, better error messages, and librification.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Emping-0.6 and Tests/Examples&lt;/em&gt;. Hans van Thiel
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60411&quot;&gt;announced&lt;/a&gt;
   version 0.6 of &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Emping&quot;&gt;Emping&lt;/a&gt;,
   a (prototype) interactive tool for the discovery and analysis of (universal,
   not statistical) predictive rules in tables of nominal data.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;haskell-src-exts-1.0.0&lt;/em&gt;. Niklas Broberg
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60392&quot;&gt;announced&lt;/a&gt;
   the first stable release of the &lt;a href=&quot;http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell%2Dsrc%2Dexts&quot;&gt;haskell-src-exts
   package&lt;/a&gt;, version 1.0.0! haskell-src-exts is a package for Haskell
   source code manipulation. In particular it defines an abstract syntax tree
   representation, and a parser and pretty-printer to convert between this
   representation and String. It handles (almost) all syntactic extensions
   to the Haskell 98 standard implemented by GHC, and the parsing can be
   parametrised on what extensions to recognise.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;HaRe (the Haskell Refactorer) in action - short screencast&lt;/em&gt;. Claus
Reinke
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60388&quot;&gt;linked&lt;/a&gt;
   to &lt;a href=&quot;http://www.youtube.com/watch?v=4I7VZV7elnY&quot;&gt;a short video&lt;/a&gt;
   showing &lt;a href=&quot;http://www.cs.kent.ac.uk/projects/refactor-fp/&quot;&gt;HaRe,
   the Haskell refactorer&lt;/a&gt;, in action. HaRe still exists---but needs some
   love in the form of time and/or funding for maintenance and continued
   development.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Trivial pivoting for the DSP lu decomposition&lt;/em&gt;. Fernan Bolando
   &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.haskell.cafe/60590&quot;&gt;announced&lt;/a&gt;
   the beginnings of a &lt;a href=&quot;http://plan9.bell-labs.com/sources/contrib/fernan/escomma.tar.bz2&quot;&gt;simple
   circuit simulator&lt;/a&gt; using haskell, which uses a modified version of
   the haskell DSP library matrix, extended with a simple pivoting method.&lt;/p&gt;
&lt;h4&gt;Discussion&lt;/h4&gt; &lt;p&gt;&lt;em&gt;make some Applicative functions into methods,
and split off Data.Functor&lt;/em&gt;. Ross Paterson
   &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.libraries/11428&quot;&gt;proposed&lt;/a&gt;
   moving several functions such as ($), (*&gt;), and so on into their
   respective classes with default definitions, to allow for specialized
   implementations.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;base library and GHC 6.12&lt;/em&gt;. Ian Lynagh
   began a &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.libraries/11413&quot;&gt;discussion&lt;/a&gt;
   about how to structure the base library in the future.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Proposal: ExplicitForall&lt;/em&gt;. Niklas Broberg
   &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.glasgow.user/17137&quot;&gt;proposed&lt;/a&gt;
   adding a new GHC extension, ExplicitForall, to be used for turning on
   explicit 'forall' syntax in types, and to help disentangle and simplify
   some existing extensions.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Generic Graph Class&lt;/em&gt;. Ivan Lazar Miljenovic
   &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.cafe/60460&quot;&gt;proposed&lt;/a&gt;
   a generic graph class to serve as a common interface for the many Haskell
   libraries that deal with graph data structures.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Type system trickery&lt;/em&gt;. Andrew Coppin
   &lt;a href=&quot;http://thread.gmane.org/gmane.comp.lang.haskell.cafe/60277&quot;&gt;asked&lt;/a&gt;
   how to statically ensure certain properties of recursive data structures
   with the type system, generating varied suggestions involving GADTs.&lt;/p&gt;
&lt;h4&gt;Blog noise&lt;/h4&gt; &lt;a href=&quot;http://planet.haskell.org&quot;&gt;Haskell news&lt;/a&gt; from
the  &lt;a href=&quot;http://haskell.org/haskellwiki/Blog_articles&quot;&gt;blogosphere.&lt;/a&gt;
Blog posts from people new to the Haskell community are marked
with &gt;&gt;&gt;, be sure to welcome them!  &lt;ul&gt;&lt;li&gt;&lt;p&gt;Magnus Therning: &lt;a href=&quot;http://therning.org/magnus/archives/664&quot;&gt;&lt;em&gt;Making a choice from a
list in Haskell, Vty (part 0)&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;The Gentoo Haskell Team: &lt;a href=&quot;http://gentoohaskell.wordpress.com/?p=3&quot;&gt;&lt;em&gt;Haskell
    in Gentoo&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Michael Snoyman: &lt;a href=&quot;http://blog.snoyman.com/2009/06/28/hack-introduction/&quot;&gt;&lt;em&gt;Hack
    Introduction&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Henry Laxen: &lt;a href=&quot;http://www.maztravel.com/haskell/readerMonad.html&quot;&gt;&lt;em&gt;Reader
    Monad Confusion&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Akshay: &lt;a href=&quot;http://www.akrish.net/2009/06/28/dynamic-programming-in-haskell-and-why-dp-is-useful/&quot;&gt;&lt;em&gt;Dynamic
    Programming in Haskell and why DP is
    useful&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;David Amos: &lt;a href=&quot;http://haskellformaths.blogspot.com/2009/06/direct-products-revisited.html&quot;&gt;&lt;em&gt;Direct
    products revisited&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;mightybyte: &lt;a href=&quot;http://softwaresimply.blogspot.com/2009/04/basic-happstack-blog-app.html&quot;&gt;&lt;em&gt;Basic
    Happstack Blog App&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;David Amos: &lt;a href=&quot;http://haskellformaths.blogspot.com/2009/06/some-groups-and-some-graphs.html&quot;&gt;&lt;em&gt;Some
    groups and some graphs&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Gergely Patai: &lt;a href=&quot;http://just-bottom.blogspot.com/2009/06/short-term-hp2any-plans.html&quot;&gt;&lt;em&gt;Short-term
    hp2any plans&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Isaac Dupree: &lt;a href=&quot;http://haddock2009.wordpress.com/2009/06/25/cross-package-plan-a/&quot;&gt;&lt;em&gt;cross-package,
    Plan A&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Oliver Reeves: &lt;a href=&quot;http://buffered.io/2009/06/25/data-crunching-in-haskell/&quot;&gt;&lt;em&gt;Data
    Crunching in Haskell&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Roman Cheplyaka: &lt;a href=&quot;http://ro-che.blogspot.com/2009/06/halting-problem.html&quot;&gt;&lt;em&gt;Halting
    problem&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Petr Rockai: &lt;a href=&quot;http://web.mornfall.net/blog/darcs_2.3_beta_1.html&quot;&gt;&lt;em&gt;darcs
    2.3 beta 1&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Eric Kow (kowey): &lt;a href=&quot;http://koweycode.blogspot.com/2009/06/haskell-syntax-highlighting-on.html&quot;&gt;&lt;em&gt;Haskell
    syntax highlighting on Wikipedia and
    Wikibooks&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Greg Bacon: &lt;a href=&quot;http://feedproxy.google.com/~r/gbacon/~3/7rlf4Dd1JKU/setting-up-simple-test-with-cabal.html&quot;&gt;&lt;em&gt;Setting
    up a simple test with Cabal&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Isaac Dupree: &lt;a href=&quot;http://haddock2009.wordpress.com/2009/06/24/cross-package-documentation-part-1/&quot;&gt;&lt;em&gt;Cross-package
    documentation, part 1&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Sean Leather: &lt;a href=&quot;http://feedproxy.google.com/~r/splonderzoek/~3/vO9VuXrFTCg/rfc-extensible-typed-scanf-and-printf.html&quot;&gt;&lt;em&gt;RFC:
    Extensible, typed scanf- and printf-like functions
    for Haskell&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Akshay: &lt;a href=&quot;http://www.akrish.net/2009/06/24/foray-into-haskell/&quot;&gt;&lt;em&gt;Foray
    Into Haskell&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Ivan Uemlianin: &lt;a href=&quot;http://llaisdy.wordpress.com/2009/06/24/decorate-sort-undecorate-in-haskell/&quot;&gt;&lt;em&gt;decorate-sort-undecorate
    in Haskell&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Isaac Dupree: &lt;a href=&quot;http://haddock2009.wordpress.com/2009/06/23/how-to-navigate-your-code/&quot;&gt;&lt;em&gt;How
    To Navigate Your Code:&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Petr Rockai: &lt;a href=&quot;http://web.mornfall.net/blog/soc_progress_5.html&quot;&gt;&lt;em&gt;soc
    progress 5&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;DEFUN 2009: &lt;a href=&quot;http://www.defun2009.info/blog/2009/06/the-tutorial-schedule-is-now-ready/&quot;&gt;&lt;em&gt;The
    tutorial schedule is now ready&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;DEFUN 2009: &lt;a href=&quot;http://www.defun2009.info/blog/2009/06/last-call-for-talk-proposals/&quot;&gt;&lt;em&gt;Last
    call for talk proposals!&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Greg Bacon: &lt;a href=&quot;http://gbacon.blogspot.com/2009/06/setting-up-simple-test-with-cabal.html&quot;&gt;&lt;em&gt;Setting
    up a simple test with Cabal&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;The GHC Team: &lt;a href=&quot;http://ghcmutterings.wordpress.com/2009/06/22/new-paper-parallel-performance-tuning-for-haskell/&quot;&gt;&lt;em&gt;New
    paper: Parallel Performance Tuning for
    Haskell&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;Brandon Simmons: &lt;a href=&quot;http://coder.bsimmons.name/blog/2009/06/fun-with-lazy-arrays-the-lz77-algorithm/&quot;&gt;&lt;em&gt;Fun
    with Lazy Arrays: the LZ77
    Algorithm&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;p&gt;&gt;&gt;&gt; Keith: &lt;a href=&quot;http://blog.keithsheppard.name/2009/06/bird-tracks-through-math-land-basic.html&quot;&gt;&lt;em&gt;Bird
    Tracks Through Math Land: Basic Matrix Ops&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;Quotes of the Week&lt;/h4&gt; &lt;ul&gt;&lt;li&gt;&lt;em&gt;gnuvince&lt;/em&gt;: Contributions to
Hackage are measured in µConals.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;DavidWheeler&lt;/em&gt;: Compatibility means deliberately repeating
    other people's mistakes.&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;About the Haskell Weekly News&lt;/h4&gt; &lt;p&gt;New editions are posted to
   &lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell&quot;&gt;the Haskell
   mailing list&lt;/a&gt; as well as to &lt;a href=&quot;http://sequence.complete.org/&quot;&gt;the
   Haskell Sequence&lt;/a&gt; and &lt;a href=&quot;http://planet.haskell.org/&quot;&gt;Planet
   Haskell&lt;/a&gt;.  &lt;a href=&quot;http://sequence.complete.org/node/feed&quot;&gt;RSS&lt;/a&gt;
   is also available, and headlines appear on &lt;a href=&quot;http://haskell.org&quot;&gt;haskell.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To help create new editions of this newsletter, please
   see the information on &lt;a href=&quot;http://haskell.org/haskellwiki/HWN&quot;&gt;how
   to contribute&lt;/a&gt;. Send stories to &lt;code&gt;byorgey at cis dot upenn
   dot edu&lt;/code&gt;.  The darcs repository is available at &lt;code&gt;darcs get &lt;a href=&quot;http://code.haskell.org/~byorgey/code/hwn/&quot;&gt;http://code.haskell.org/~byorgey/code/hwn/&lt;/a&gt;
   .&lt;/code&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 29 Jun 2009 20:06:16 +0000</pubDate>
	<dc:creator>byorgey</dc:creator>
</item>
<item>
	<title>Galois, Inc: Galois, Inc. Wins Two Small Business Research Awards from Federal Agencies</title>
	<guid isPermalink="false">http://www.galois.com/blog/?p=872</guid>
	<link>http://www.galois.com/blog/2009/06/29/galois-awarded-two-federal-sbirs/</link>
	<description>&lt;p&gt;&lt;a class=&quot;ext-link&quot; href=&quot;http://www.galois.com/&quot;&gt;Galois, Inc&lt;/a&gt;., a Portland, Oregon research and development company, has been awarded two Phase I &lt;a class=&quot;ext-link&quot; href=&quot;http://en.wikipedia.org/wiki/SBIR&quot;&gt;Small Business Innovative Research&lt;/a&gt; contracts. Galois will be engaging with the Department of Energy and the Department of Homeland Security on innovative technology solutions.&lt;/p&gt;
&lt;h3&gt;DHS Topic: Highly Scalable Identity Management Tools&lt;/h3&gt;
&lt;p&gt;Galois has been granted a &lt;a class=&quot;ext-link&quot; href=&quot;https://www.sbir.dhs.gov/AbstractAwards.asp?SolicitationID=11&amp;amp;Phase=1&quot;&gt;Phase I SBIR from the Department of Homeland Security&lt;/a&gt; to develop a reusable &lt;a class=&quot;ext-link&quot; href=&quot;http://en.wikipedia.org/wiki/Identity_management&quot;&gt;identity management metasystem&lt;/a&gt; which will be designed foundationally to support government certification for deployment across agency boundaries, focusing on open standards, secure development, and a &lt;a class=&quot;ext-link&quot; href=&quot;http://en.wikipedia.org/wiki/Cross_Domain_Solutions&quot;&gt;cross-domain&lt;/a&gt; design.&lt;/p&gt;
&lt;p&gt;The Department of Homeland Security&amp;#8217;s charter has a fundamental requirement to collaborate with other government agencies. Secure collaboration on this scale requires strong identity management which can &amp;#8220;vouch for&amp;#8221; DHS personnel working with other agencies and makes it possible to provide DHS resources to individuals in other agencies whose work requires it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anticipated Benefits&lt;/strong&gt;: This work will provide an opportunity to deploy standard trusted components in a variety of agencies, each of which can continue to maintain its own method of managing identity and authorization. Agencies can share information based on this layer, which will evolve to support a wide variety of needs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Potential commercial applications&lt;/strong&gt;: Compliance with government standards of trustworthiness in software used for critical purposes, along with a user-centric approach to identity management, can enable Internet users to merge their many usernames and passwords, allow critical transactions to be executed with a higher degree of trust, and help bring about an environment where e-voting increases voters&amp;#8217; trust in the validity of the outcome of elections.&lt;/p&gt;
&lt;h3&gt;DOE Topic: Grid 2.0: Collaboration and Sharing on the Grid&lt;/h3&gt;
&lt;p&gt;Galois has been granted a &lt;a class=&quot;ext-link&quot; href=&quot;http://www.science.doe.gov/sbir/awards_abstracts/sbirsttr/cycle27/phase1/p1_award.htm&quot;&gt;Phase I SBIR from the Department of Energy&lt;/a&gt; to implement a Web 2.0 collaboration system based on &lt;a class=&quot;ext-link&quot; href=&quot;http://en.wikipedia.org/wiki/Grid_computing&quot;&gt;Grid technologies&lt;/a&gt;. Galois&amp;#8217; system will allow dispersed scientific teams to collaborate effectively on large amounts of data produced by collections of networked computers.&lt;/p&gt;
&lt;p&gt;Grid computing makes accessible significant computational and data resources to distributed teams of scientific researchers. In doing so, it also poses a challenge: How do distributed teams collaborate effectively with these resources?&lt;/p&gt;
&lt;p&gt;The problem is determining how best to apply social and collaboration software techniques to improve the efficiency of collaboration between distributed teams working on grid systems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Potential Commercial Applications&lt;/strong&gt;: Grid computing is inherently social in the sense of involving multiple, loosely connected parties. Social collaboration in the area of large datasets is relevant to industrial and academic scientists.&lt;/p&gt;
&lt;h3&gt;About Galois, Inc.&lt;/h3&gt;
&lt;p&gt;Galois is a research and development company with a strong drive to transition technology from research into practice in the commercial and government sphere. Located in downtown Portland, Galois is a company of around 35 employees, including software developers, project managers, and business development personnel. Galois has experience in programming language design and compiler implementation, secure web application development, secure operating system development, and several other fields. Since its founding in 1999, Galois has been funded for R&amp;amp;D by members of the Intelligence Community and the DoD.  Read more about Galois&amp;#8217; &lt;a class=&quot;ext-link&quot; href=&quot;http://www.galois.com/technology/research_catalog&quot;&gt;research&lt;/a&gt; and &lt;a class=&quot;ext-link&quot; href=&quot;http://www.galois.com/technology/technology_catalog&quot;&gt;technology&lt;/a&gt; on their web site: &lt;a class=&quot;ext-link&quot; href=&quot;http://www.galois.com/&quot;&gt;www.galois.com&lt;/a&gt;.&lt;/p&gt;</description>
	<pubDate>Mon, 29 Jun 2009 17:04:57 +0000</pubDate>
	<dc:creator>Galois</dc:creator>
</item>
<item>
	<title>Greg Bacon: Cleaning up your Haskell imports</title>
	<guid isPermalink="false">tag:blogger.com,1999:blog-16846333.post-6147940259070038863</guid>
	<link>http://feedproxy.google.com/~r/gbacon/~3/AGNKaCB2-GI/cleaning-up-your-haskell-imports.html</link>
	<description>Explicit imports have a couple of benefits. For one, doing so &lt;a href=&quot;http://www.haskell.org/ghc/docs/6.0/html/users_guide/sooner-faster-quicker.html&quot;&gt;reduces compile times with ghc&lt;/a&gt;. Another is giving a hand to your future self (or other maintainers) and especially to those who are reading your code to learn. We've all been there: scratching our heads wondering, ‘Where does &lt;em&gt;that&lt;/em&gt; function live?’ Yes, &lt;a href=&quot;http://www.haskell.org/ghc/docs/6.10.3/html/users_guide/ghci-commands.html#id2899386&quot;&gt;ghci's &lt;tt&gt;:info&lt;/tt&gt; command&lt;/a&gt; and &lt;a href=&quot;http://www.haskell.org/hoogle/&quot;&gt;Hoogle&lt;/a&gt; are your friends, but explicit imports right there in your code will give the answer in a snap.
&lt;p&gt;
&lt;a href=&quot;http://neilmitchell.blogspot.com/2009/01/small-scripts-with-haskell.html&quot;&gt;Neil Mitchell calls explicit imports “needlessly verbose,”&lt;/a&gt; certainly a fair point in the context where he made it, so this is a matter of polish, not strict necessity. There's also a certain aspy-appeal to it.
&lt;p&gt;
The &lt;a href=&quot;http://www.haskell.org/ghc/docs/6.10.3/html/users_guide/separate-compilation.html#id2915722&quot;&gt;&lt;tt&gt;-ddump-minimal-imports&lt;/tt&gt; option to ghc&lt;/a&gt; writes the cleaned-up list to &lt;tt&gt;&lt;i&gt;M&lt;/i&gt;.imports&lt;/tt&gt;, where &lt;i&gt;M&lt;/i&gt; is the module being compiled. For example, consider the following code that finds anagrams in a dictionary file:
&lt;pre&gt;&lt;a name=&quot;line-1&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Main&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt;
&lt;a name=&quot;line-2&quot;&gt;&lt;/a&gt;
&lt;a name=&quot;line-3&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Control&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Arrow&lt;/span&gt;
&lt;a name=&quot;line-4&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Control&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Monad&lt;/span&gt;
&lt;a name=&quot;line-5&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Char&lt;/span&gt;
&lt;a name=&quot;line-6&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;List&lt;/span&gt;
&lt;a name=&quot;line-7&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Map&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;hiding&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;a name=&quot;line-8&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Environment&lt;/span&gt;
&lt;a name=&quot;line-9&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Exit&lt;/span&gt;
&lt;a name=&quot;line-10&quot;&gt;&lt;/a&gt;&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt;
&lt;a name=&quot;line-11&quot;&gt;&lt;/a&gt;
&lt;a name=&quot;line-12&quot;&gt;&lt;/a&gt;&lt;a name=&quot;usage&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;usage&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;a&lt;/span&gt;
&lt;a name=&quot;line-13&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;usage&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;do&lt;/span&gt;
&lt;a name=&quot;line-14&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;varid&quot;&gt;me&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;getProgName&lt;/span&gt;
&lt;a name=&quot;line-15&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;varid&quot;&gt;hPutStrLn&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;stderr&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Usage: &quot;&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;me&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; [ dictionary ]&quot;&lt;/span&gt;
&lt;a name=&quot;line-16&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;varid&quot;&gt;exitWith&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;ExitFailure&lt;/span&gt; &lt;span class=&quot;num&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;a name=&quot;line-17&quot;&gt;&lt;/a&gt;
&lt;a name=&quot;line-18&quot;&gt;&lt;/a&gt;&lt;a name=&quot;main&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;()&lt;/span&gt;
&lt;a name=&quot;line-19&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt;
&lt;a name=&quot;line-20&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;varid&quot;&gt;getPath&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;readFile&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;mapM_&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;putStrLn&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;unwords&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;sorted&lt;/span&gt;
&lt;a name=&quot;line-21&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;sorted&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;anagrams&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;lines&lt;/span&gt;
&lt;a name=&quot;line-22&quot;&gt;&lt;/a&gt;
&lt;a name=&quot;line-23&quot;&gt;&lt;/a&gt;&lt;a name=&quot;anagrams&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;anagrams&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;keyglyph&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;keyglyph&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;keyglyph&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;keyglyph&quot;&gt;]&lt;/span&gt;
&lt;a name=&quot;line-24&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;anagrams&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;filter&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;num&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;equiv&lt;/span&gt;
&lt;a name=&quot;line-25&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;equiv&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;elems&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;$&lt;/span&gt;
&lt;a name=&quot;line-26&quot;&gt;&lt;/a&gt;                  &lt;span class=&quot;varid&quot;&gt;fromListWith&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;a name=&quot;line-27&quot;&gt;&lt;/a&gt;                    &lt;span class=&quot;keyglyph&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;normal&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;keyglyph&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;]&lt;/span&gt;
&lt;a name=&quot;line-28&quot;&gt;&lt;/a&gt;        &lt;span class=&quot;varid&quot;&gt;normal&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;toLower&lt;/span&gt;
&lt;a name=&quot;line-29&quot;&gt;&lt;/a&gt;
&lt;a name=&quot;line-30&quot;&gt;&lt;/a&gt;&lt;a name=&quot;getPath&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;getPath&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;FilePath&lt;/span&gt;
&lt;a name=&quot;line-31&quot;&gt;&lt;/a&gt;&lt;span class=&quot;definition&quot;&gt;getPath&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;getArgs&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;go&lt;/span&gt;
&lt;a name=&quot;line-32&quot;&gt;&lt;/a&gt;  &lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;go&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;keyglyph&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;path&lt;/span&gt;
&lt;a name=&quot;line-33&quot;&gt;&lt;/a&gt;        &lt;span class=&quot;varid&quot;&gt;go&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;[]&lt;/span&gt;     &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;/usr/share/dict/words&quot;&lt;/span&gt;
&lt;a name=&quot;line-34&quot;&gt;&lt;/a&gt;        &lt;span class=&quot;varid&quot;&gt;go&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;_&lt;/span&gt;      &lt;span class=&quot;keyglyph&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;usage&lt;/span&gt;&lt;/pre&gt;
To get the minimal set of imports:
&lt;pre&gt;$ ghc-6.10.3 -ddump-minimal-imports --make anagram.hs 
$ cat Main.imports
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;IO&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;FilePath&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;putStrLn&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;readFile&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;hPutStrLn&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt;
                 &lt;span class=&quot;varid&quot;&gt;stderr&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;elems&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;fromListWith&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Control&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Arrow&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;()&lt;/span&gt;    &lt;span class=&quot;comment&quot;&gt;-- Instances only&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Control&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Monad&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Monad&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;mapM_&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Char&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;toLower&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;lines&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;unwords&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Environment&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;getArgs&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;getProgName&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;conid&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;varop&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;Exit&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;ExitCode&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;ExitFailure&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;exitWith&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
Although nice, the result is less than satisfying. The cuddled lists are ugly. The imports are in an odd order. Having to do run a separate compilation by hand followed by copy-paste, as opposed to automatically à la &lt;a href=&quot;http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-22.htm&quot;&gt;Eclipse's organize imports for Java&lt;/a&gt;, is a bit of a pain.
&lt;p&gt;
Notice that although Control.Arrow is unnecessary, it remains in the “minimal” set with an empty import list. Its presence is an artifact of the list comprehension being equivalent to
&lt;pre&gt;&lt;span class=&quot;varid&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;varid&quot;&gt;normal&lt;/span&gt; &lt;span class=&quot;varop&quot;&gt;&amp;amp;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;layout&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;conop&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;conid&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;layout&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;varid&quot;&gt;words&lt;/span&gt;&lt;/pre&gt;
Cool, yes. Readable, not so much.
&lt;p&gt;Note also there's an &lt;a href=&quot;http://hackage.haskell.org/trac/ghc/ticket/1792&quot;&gt;open ticket against ghc concerning the interaction between &lt;tt&gt;-ddump-minimal-imports&lt;/tt&gt; and qualified imports&lt;/a&gt;.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/16846333-6147940259070038863?l=gbacon.blogspot.com&quot; /&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/gbacon/~4/AGNKaCB2-GI&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 29 Jun 2009 17:27:38 +0000</pubDate>
	<dc:creator>Greg (greg.bacon@gmail.com)</dc:creator>
</item>
<item>
	<title>Douglas M. Auclair (geophf): Realized Constants are Comonadic</title>
	<guid isPermalink="false">tag:blogger.com,1999:blog-4650294074444534066.post-8277363035802655493</guid>
	<link>http://logicaltypes.blogspot.com/2009/06/realized-constants-are-comonadic.html</link>
	<description>An interesting problem that often arises is &quot;to make&quot; constants.  Put another way, it often happens that a system acquires information over time.  The system may wish to formalize what it has acquired by creating a constant value.&lt;br /&gt;&lt;br /&gt;Here's the problem, however: &quot;Variables don't; Constants aren't&quot;&lt;small&gt;&lt;sup&gt;citation?&lt;/sup&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;Or, put another way:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;1. &lt;a href=&quot;http://www.cs.yale.edu/quotes.html&quot;&gt;One man's constant is another man's variable&lt;/a&gt;.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;To make a constant sometime down the road, as it were, in languages that have logic variables is simplicity itself: once a variable is unified with a value, it keeps that value throughout that proof.&lt;br /&gt;&lt;br /&gt;In &quot;pure&quot; functional languages, that is, languages that do not have side effects, the same can be said.&lt;br /&gt;&lt;br /&gt;What about the rest of the world?  Take Java, for example.  One can make a variable keep its value by declaring that variable &lt;code&gt;final&lt;/code&gt;, but that is not helpful if we do not know what our constant value is to be at the time of object creation.&lt;br /&gt;&lt;br /&gt;In what scenario could this possibly occur?  We need a constant value, but we do not know what it is?&lt;br /&gt;&lt;br /&gt;Actually, this situation arises quite frequently.  Let's take a concrete example.  You have many databases in your database management system, and at compile time you do not know on which port your DBMS is running nor do you know which database the user wishes to query.  That's fine, you can lazily create the database connection and access the value through a method:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;2. &lt;a href=&quot;http://www.cs.yale.edu/quotes.html&quot;&gt;Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process&lt;/a&gt;. &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;But what's not fine is this: the user is data-mining, examining chunks at a time, occasionally calling for the next chunk.  How does one know that one has fallen off the end of the table?  A simple &lt;code&gt;SELECT&lt;/code&gt; on the maximum indexed key will tell you that, but to do that with every query?  This seems wasteful.  So, once we do the query once, let's just store that value in a variable with a flag to say we've already looked it up.&lt;br /&gt;&lt;br /&gt;That sounds suspiciously like a lazily initialized constant, right?&lt;br /&gt;&lt;br /&gt;But here's the rub: code that sets a flag allows for other code to unset it, just as code that sets a constant value allows other code to unset that.  Using just plain-old regular variables gives no guarantee that the variable, once set, stays set at that constant value.&lt;br /&gt;&lt;br /&gt;What to do?&lt;br /&gt;&lt;br /&gt;Well, what is the work-flow of this process?  We perform an action, checking that we are still within the bounds the valid domain, but the domain only becomes valid after program start, so we cannot make the bounds constant using the &lt;code&gt;final&lt;/code&gt; keyword on the variable.  This is a very common programming action ... sort of like ... dare I say ... a &lt;a href=&quot;http://en.wikipedia.org/wiki/Design_patterns&quot;&gt;design pattern&lt;/a&gt;.  Gee, I wish there was one invented that did all this.&lt;br /&gt;&lt;br /&gt;In fact, there does exist such a pattern, and it comes from us via &lt;a href=&quot;http://en.wikipedia.org/wiki/Category_theory&quot;&gt;Category Theory&lt;/a&gt;.  The programming language &lt;a href=&quot;http://haskell.org/&quot;&gt;Haskell&lt;/a&gt; has incorporated elements of Category theory in its use of &lt;a href=&quot;http://www.haskell.org/all_about_monads/html/introduction.html#what&quot;&gt;monads&lt;/a&gt; and &lt;a href=&quot;http://www.haskell.org/arrows/&quot;&gt;arrows&lt;/a&gt;, but the downside of these ways of thinking about computation is that one must &quot;lift&quot; the entire computation into that domain, transforming the original computation to work in that regime.&lt;br /&gt;&lt;br /&gt;No, what is needed is something less intrusive, and I found that less intrusive thing when I read an article by &lt;a href=&quot;http://blog.sigfpe.com/&quot;&gt;sigfpe&lt;/a&gt; on &lt;a href=&quot;http://comonad.com/reader/&quot;&gt;comonadic&lt;/a&gt; &lt;a href=&quot;http://blog.sigfpe.com/2008/06/categories-of-polynomials-and-comonadic.html&quot;&gt;plumbing&lt;/a&gt;.  In this article he describes three different ways of looking at constants:  1. as a constant, 2. as the &lt;tt&gt;Reader Monad&lt;/tt&gt;, 3. or as the &lt;tt&gt;Reader Comonad&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;The first one is sometimes untenable, given the programming need, and doesn't work for our case.&lt;br /&gt;&lt;br /&gt;The second one is useful if one is already programming in a monad.  Umm ... how many OO programmers use monads?  Hands up.&lt;br /&gt;&lt;br /&gt;[sound of crickets] ... thought so.&lt;br /&gt;&lt;br /&gt;The third one allows one to use the constant on demand.  And here's the thing, the comonad is very easily comprehended: it has a value that can be &lt;code&gt;extract&lt;/code&gt;ed &quot;down&quot; from the comonad, it allows a value to be &lt;code&gt;extend&lt;/code&gt;ed over the comonad.&lt;br /&gt;&lt;br /&gt;This sounds, in OO parlance, very much like an object.  Let's ignore the extentionability of the comonad for now and simply look at extraction (this narrowed functionality is a thing in and of itself.  Objects of this type are called &lt;tt&gt;&lt;a href=&quot;http://conal.net/blog/posts/sequences-streams-and-segments/&quot;&gt;Copointed&lt;/a&gt;&lt;/tt&gt;, but let us not be too dogmatic here).  Creating such a type is simplicity itself:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&gt; public interface &lt;tt&gt;Comonad&amp;lt;T&gt;&lt;/tt&gt; { public &lt;tt&gt;T&lt;/tt&gt; extract(); }&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Um, yawn?&lt;br /&gt;&lt;br /&gt;But that is the power of pattern language: not the ability to create these incredibly complex things in a controlled way (they do do that), but the ability to recognize that such and so is a pattern and then encapsulate behavior into the pattern.&lt;br /&gt;&lt;br /&gt;Using the comonad pattern, we need simply to make our &quot;maximum row number of Table x&quot; an implementation of the &lt;tt&gt;Comonad&lt;/tt&gt; interface, and then, when we do have enough information to create the datab