<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19751422</id><updated>2011-07-08T04:28:36.955+02:00</updated><category term='muzik'/><category term='darcs'/><category term='soc'/><category term='ghci_debugger'/><category term='personalandpointless'/><category term='haskell'/><category term='programming'/><category term='ghc'/><category term='mac'/><title type='text'>blog :: Date -&gt; Maybe String</title><subtitle type='html'>blog = const Nothing</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19751422.post-4037583868315591310</id><published>2007-03-30T19:04:00.000+02:00</published><updated>2007-04-17T12:04:43.590+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><category scheme='http://www.blogger.com/atom/ns#' term='ghc'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>More on Gtk2Hs on Mac Os X</title><content type='html'>It turns out that the &lt;a href="http://pepeiborra.blogspot.com/2007/03/gtk2hs-on-mac-os.html"&gt;problem&lt;/a&gt; with Gtk2Hs was not related at all to GMP or OS X frameworks. The issue is related to &lt;a href="http://hackage.haskell.org/trac/ghc/ticket/957"&gt;ticket #957&lt;/a&gt; and libraries not in the default search path.  The problem is fixed by passing the flags '-L/opt/local/lib -I/opt/local/include'  to ghc when compiling a Haskell module that uses Gtk2Hs. The right thing to do, copied from the MacPorts book, is to edit your ghc driver (mine lives at /usr/local/bin/ghc) and add these flags there:&lt;br /&gt;&lt;br /&gt;Contents of my /usr/local/bin/ghc file:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;GHCBIN="/usr/local/lib/ghc-6.7.20070328/ghc-6.7.20070328";&lt;br /&gt;TOPDIROPT="-B/usr/local/lib/ghc-6.7.20070328";&lt;br /&gt;# Mini-driver for GHC&lt;br /&gt;exec $GHCBIN $TOPDIROPT ${1+"$@"} -L/opt/local/lib -I/opt/local/include&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-4037583868315591310?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/4037583868315591310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=4037583868315591310' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/4037583868315591310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/4037583868315591310'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2007/03/more-on-gtk2hs-on-mac-os-x.html' title='More on Gtk2Hs on Mac Os X'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-1066019590572838256</id><published>2007-03-09T03:34:00.000+01:00</published><updated>2007-03-30T18:57:17.452+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='personalandpointless'/><title type='text'>If I had time</title><content type='html'>Projects I would work on if I had a bit more time.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An improved way to handle exceptions for Haskell I have half-thought. More on this soon&lt;/li&gt;&lt;li&gt;review &lt;a href="http://www.cse.unsw.edu.au/%7Edons/hs-plugins/"&gt;hs-plugins&lt;/a&gt; and get it to work on the Mac&lt;/li&gt;&lt;li&gt;A Dashboard widget for the awesome &lt;a href="http://lambdabot.codersbase.com/"&gt;Lambdabot&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Read all those papers I want to read (sic)&lt;/li&gt;&lt;li&gt;Finally get the mutable engine in the &lt;a href="http://www.mutantlemon.com/omegagb/devlog/"&gt;Omega Gameboy&lt;/a&gt; emulator to work, after all the time I have invested already (should put a Darcs repo up). Then the fun begins: profile and optimize extensively&lt;/li&gt;&lt;li&gt;Blog more&lt;/li&gt;&lt;li&gt;Get a website for myself&lt;/li&gt;&lt;li&gt;Definitely... read GTD and start getting things off this list&lt;/li&gt;&lt;/ul&gt;Projects I will work on as soon as I get the time.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The ghc 6.7 branch of &lt;a href="http://shim.haskellco.de/"&gt;Shim&lt;/a&gt;: Integrating the debugger. I have already some code but I'm waiting for soon-to-come changes in the debugging primitives in the ghc-api&lt;/li&gt;&lt;li&gt;Send patches for the &lt;a href="http://haskell.org/haskellwiki/GHC/GHCiDebugger"&gt;GHCi debugger&lt;/a&gt;... bugfixes, new bugs, new commands, experiments, etc.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-1066019590572838256?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/1066019590572838256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=1066019590572838256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/1066019590572838256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/1066019590572838256'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2007/03/if-i-had-time.html' title='If I had time'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-4036015527216516326</id><published>2007-03-07T01:29:00.001+01:00</published><updated>2007-03-30T19:08:41.700+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><category scheme='http://www.blogger.com/atom/ns#' term='ghc'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>Gtk2Hs on Mac Os</title><content type='html'>&lt;p style="text-align: center;"&gt;&lt;a href="http://www.mutantlemon.com/omegagb/devlog/images/omegagb-0005.png" onclick="window.open('http://www.mutantlemon.com/omegagb/devlog/images/omegagb-0005.png','popup','width=164,height=190,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"&gt;&lt;img src="http://www.mutantlemon.com/omegagb/devlog/images/omegagb-0005.png" alt="Omegagb-0005" border="1" height="100" hspace="4" vspace="4" width="86" /&gt;&lt;/a&gt;&lt;/p&gt;It all started with the&lt;a href="http://www.mutantlemon.com/omegagb/devlog/"&gt; Omega Gameboy Emulator&lt;/a&gt; written in Haskell. I got interested by the optimization challenge, it's a cool project after all, even though Haskell is not the most appropriate choice of a language. As a matter of fact I've never been a low-level guy, a systems programmer, but this project had its allure. After having played with the Universal Machine VM this summer during the ICFP contest, I found that I could understand the code very quickly.&lt;br /&gt;&lt;br /&gt;After a few days hacking on Omega (it turns out that of the two alternative implementations of the CPU, the fast one was half-coded only, so I wasted a lot of time trying to debug it until I found this out), I got the unstoppable desire of seeing the emulator in action. I had been trying to avoid this, because I knew that setting up Gtk2hs on my Mac Os X86 would be a nightmare, but I just couldn't let go.&lt;br /&gt;&lt;br /&gt;So here go my findings. These apply to the current release of Gtk2Hs, that is 0.9.11. I installed gtk2 via MacPorts, and hand compiled Gtk2Hs.&lt;br /&gt;&lt;br /&gt;First, home compiled versions of GHC won't work. Gtk2Hs itself will make and install fine, but the helloworld demo will die with a "bus error". GDB is pretty useless to debug the problem. But someone in #haskell told me that MacPorts GHC would work, though he didn't know why. I tested this and he was right. So I digged into the MacPort install script for GHC, and it seemingly has to do with treating GMP as a lib instead of as a framework.&lt;br /&gt;So this is what I found. GHC has a section in the configure.ac file to look for a GMP framework and use that. MacPorts installs GMP as a lib, and since all MacPorts ports try and succeed in eating their own food, the GHC port includes a patch to teach the configure script to use their GMP lib, and ignore any framework.&lt;br /&gt;&lt;br /&gt;I don't really understand how frameworks are supposed to work in Mac Os, so I don't know if this makes any sense at all, but now my home compiled GHC is able to compile Gtk2Hs and Haskell code using Gtk, and everything works. I guess it should be possible to manually apply the patch at &lt;a href="http://trac.macosforge.org/projects/macports/browser/trunk/dports/lang/ghc/files/patch-configure.ac"&gt;the ghc port&lt;/a&gt;, but I haven't tested it; I did my changes by hand to my package.conf file.&lt;br /&gt;&lt;br /&gt;UPDATE: The real fix is given in a &lt;a href="http://pepeiborra.blogspot.com/2007/03/more-on-gtk2hs-on-mac-os-x.html"&gt;later post&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-4036015527216516326?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/4036015527216516326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=4036015527216516326' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/4036015527216516326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/4036015527216516326'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2007/03/gtk2hs-on-mac-os.html' title='Gtk2Hs on Mac Os'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-116127608118994788</id><published>2006-10-19T18:34:00.000+02:00</published><updated>2007-03-30T18:49:41.773+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='muzik'/><title type='text'>www.songmeanings.net</title><content type='html'>What is better than procrastinating and listening to music at the same time? You got it: procrastinating about music.&lt;br /&gt;&lt;br /&gt;This is a short entry to comment on said site. I just stomped on it, surprisingly via google. Yes, I didn't use any of the flashy diggit-readit-web-2.0-cool-sites-that-talk-about-sites-or-blogs... So, I have spent the whole evening procrastinating around its contents. And how we love these things... There is another thing we people love (apart from Of Montreal's Hissing Fauna album of course), and that is silly statistics, the sillier the merrier. Or look at Last.fm success (disclaimer: I love this sort of things too)&lt;br /&gt;&lt;br /&gt;Before finding it I didn't know how addicted I was to song commenting!&lt;br /&gt;After all it makes a lot of sense; people comment on albums, movies, shows, and personal posts such as this one! (sadly this blog is mostly comment-less, so it is not a good example).&lt;br /&gt;&lt;br /&gt;So thanks to my newfound addiction, I've spent all this time digging each and every comment on every song of my latest fetish album: Hissing Fauna by Of Montreal. It is an impressive album. It is always impressive when a band produces its masterpiece, but it is jawdropping when this masterpiece comes as what makes their 10th studio album. How not to love &lt;a href="http://www2.blogger.com/www.songmeanings.net"&gt;songmeanings.net&lt;/a&gt; when you find comments as reassuring as:&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;"Hissing&lt;/strong&gt; Fauna, Are You the Destroyer?" is final, clinching proof that Kevin Barnes is totally crazy. And totally awesome.&lt;br /&gt;(on &lt;em&gt;Faberge Falls For Shuggie&lt;/em&gt;)&lt;/blockquote&gt;Other funny comments that you can find on the songs in Hissing Fauna:&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;Favorite&lt;/strong&gt; song. It's ridonkulous.&lt;br /&gt;(on &lt;em&gt;Heimdalsgate Like a Promethean Curse&lt;/em&gt;)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;By&lt;/strong&gt; the way, it is definetely about drugs.&lt;br /&gt;(on &lt;em&gt;Heimdalsgate Like a Promethean Curse&lt;/em&gt;)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My&lt;/strong&gt; mom flat out asked me what the hell this song was about, and I simply told her&lt;br /&gt;"Someone who is having a chemical imbalance and wants to be in a good mood, this their chemical imbalance shifting."&lt;br /&gt;It's kind of funny I should be able to sum it up in a few lines. It's such a deep song.&lt;br /&gt;(on &lt;em&gt;Heimdalsgate Like a Promethean Curse&lt;/em&gt;)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;"the &lt;/strong&gt;mousey girl screams violence, violence&lt;br /&gt;the mousey girl screams violence&lt;br /&gt;she gets hysterical&lt;br /&gt;'cause they're both so mean&lt;br /&gt;and it's my favorite scene&lt;br /&gt;oh, the cruelty so predictable&lt;br /&gt;makes you sad on the stage"&lt;br /&gt;&lt;br /&gt;Reference to Edward Albee's play Who's Afriad of Virginia Woolf. Honey, the mousey character, does scream "Violence!   Violence!" at a point in the play when George and Martha are at each others throats.&lt;br /&gt;(on &lt;em&gt;The Past Is A Grotesque Animal&lt;/em&gt;)&lt;/blockquote&gt;The last one is too clever for me, but I mean, I looove this kind of stuff. When I'm not punishing my brain with Haskell, I'm either procrastinating or listening to music. And lately often procrastinating about music.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-116127608118994788?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/116127608118994788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=116127608118994788' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/116127608118994788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/116127608118994788'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/10/wwwsongmeaningsnet.html' title='www.songmeanings.net'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-116108836155067109</id><published>2006-10-17T14:24:00.000+02:00</published><updated>2007-03-30T18:54:16.179+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='soc'/><category scheme='http://www.blogger.com/atom/ns#' term='personalandpointless'/><title type='text'>Just received my Summer of Code T-shirt</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/4793/1961/1600/MyPicture.jpg"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger/4793/1961/320/MyPicture.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now I can brag around my Uni with it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-116108836155067109?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/116108836155067109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=116108836155067109' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/116108836155067109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/116108836155067109'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/10/just-received-my-summer-of-code-t.html' title='Just received my Summer of Code T-shirt'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-115891601289708810</id><published>2006-09-22T10:53:00.000+02:00</published><updated>2007-03-30T18:55:20.368+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><category scheme='http://www.blogger.com/atom/ns#' term='ghci_debugger'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>The ICFP contest has a winner!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.icfpcontest.org/teaser.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px;" src="http://www.icfpcontest.org/teaser.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And no, this year Haskell is not the language of choice :(&lt;br /&gt;&lt;br /&gt;Don't miss the &lt;a href="http://video.google.com/videoplay?docid=6419094369756184531"&gt;video&lt;/a&gt; of the presentation at ICFP, seriously cool stuff, at least if you can follow the geeky -rather academia- jokes. Only by watching it you'll find out which is the super-cool multinational company that has conquered both 1st and 3rd prize this year.&lt;br /&gt;&lt;br /&gt;#haskell managed to have 5 teams among the first 50: Lazy Bottoms, DunComLooLump, Deus Ex Machina, Team Roflcopter, and the Int-E lone ranger team. Not too shabby, though nothing compared to previous successes. None of the winners this year used a high-level language.&lt;br /&gt;&lt;br /&gt;By the way, a few weeks ago I made a video to showcase the &lt;a href="http://haskell.org/haskellwiki/GHC/GHCiDebugger"&gt;ghci debugger&lt;/a&gt; which used the ICFP contest task as an example. &lt;a href="http://darcs.haskell.org/SoC/ghc.debugger/demo.mov"&gt;Watch it!&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-115891601289708810?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/115891601289708810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=115891601289708810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115891601289708810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115891601289708810'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/09/icfp-contest-has-winner.html' title='The ICFP contest has a winner!'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-115891520233044165</id><published>2006-09-22T10:49:00.000+02:00</published><updated>2007-03-30T18:55:46.400+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><category scheme='http://www.blogger.com/atom/ns#' term='ghci_debugger'/><title type='text'>Debugging in Haskell</title><content type='html'>Some few days ago, an innocent query sparkled &lt;a href="http://www.haskell.org/pipermail/haskell-cafe/2006-September/017858.html"&gt;a fiery discussion &lt;/a&gt;in the Haskell mailing list, this time about the virtues and vices of debugging.&lt;br /&gt;&lt;br /&gt;At the time I did put up a quick survey &lt;a href="http://haskell.org/haskellwiki/Debugging"&gt;page&lt;/a&gt; in the wiki about the various debugging options available in Haskell (including the ghci debugger, of course!), but I didn't think about mentioning it here. A partial rip-off of that page follows.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Printf and friends&lt;/span&gt;&lt;br /&gt;The simplest approach is to use &lt;tt&gt;Debug.Trace.trace&lt;/tt&gt;:&lt;br /&gt;&lt;pre&gt;trace :: String -&gt; a -&gt; a&lt;br /&gt;&lt;/pre&gt;When called, trace outputs the string in its first argument, before returning the second argument as its result.&lt;br /&gt;&lt;br /&gt;A common idiom to trace a function is:&lt;br /&gt;&lt;pre&gt;myfun a b | trace ("myfun " ++ show a ++ " " ++ show b) False = undefined&lt;br /&gt;myfun a b = ...&lt;br /&gt;&lt;/pre&gt;The advantage is that disabling and enabling the trace takes only one line comment.&lt;br /&gt;You must keep in mind that due to lazy evaluation your traces will only print if the value they wrap is ever demanded.&lt;br /&gt;&lt;br /&gt;A more powerful alternative for this approach is &lt;a href="http://www.haskell.org/hood"&gt;Hood&lt;/a&gt;. Even if it hasn't been updated in some time, Hood works perfectly with the current ghc distribution. Even more, Hugs has it already integrated, see the &lt;a href="http://cvs.haskell.org/Hugs/pages/users_guide/observe.html"&gt;manual page&lt;/a&gt;. Add an &lt;tt&gt;import Observe&lt;/tt&gt; and start inserting observations in your code.&lt;br /&gt;For instance:&lt;br /&gt;&lt;pre&gt;import Hugs.Observe&lt;br /&gt;&lt;br /&gt;f'  = observe "Informative name for f" f&lt;br /&gt;f x = if odd x then x*2 else 0&lt;br /&gt;&lt;/pre&gt;And then in hugs:&lt;br /&gt;&lt;pre&gt;Main&gt; map f' [1..5]&lt;br /&gt;[2,0,6,0,10]&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Observations &lt;&lt;&lt;&lt;&lt;&lt;&gt; 10&lt;br /&gt;, \ 4  -&gt; 0&lt;br /&gt;, \ 3  -&gt; 6&lt;br /&gt;, \ 2  -&gt; 0&lt;br /&gt;, \ 1  -&gt; 2&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;The evaluation outputs a report of all the invocations of f and their result.&lt;br /&gt;&lt;br /&gt;I have a handy bogus Hugs.Observe module with no-ops for the observations so that I don't need to remove them manually, expecting that the compiler will optimize them away.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Dynamic breakpoints in GHCi&lt;/span&gt;&lt;br /&gt;Finally, the &lt;a href="http://haskell.org/haskellwiki/GHC/GHCiDebugger"&gt;GHCi Debugger&lt;/a&gt; project aims to bring dynamic breakpoints and intermediate values observation to GHCi in a near future. Right now the tool is only available from the site as a modified version of GHC, so unfortunately you will have to compile it yourself if you want to have it.&lt;br /&gt;&lt;br /&gt;This tool allows to set breakpoints in your code, directly from the GHCi command prompt. An example session:&lt;br /&gt;&lt;pre&gt;*main:Main&gt; :break add Main 2&lt;br /&gt;Breakpoint set at (2,15)&lt;br /&gt;*main:Main&gt; qsort [10,9..1]&lt;br /&gt;Local bindings in scope:&lt;br /&gt;x :: a, xs :: [a], left :: [a], right :: [a]&lt;br /&gt;&lt;br /&gt;qsort2.hs:2:15-46&gt; :sprint x&lt;br /&gt;x = _&lt;br /&gt;qsort2.hs:2:15-46&gt; x&lt;br /&gt;This is an untyped, unevaluated computation. You can use seq to&lt;br /&gt;force its evaluation and then :print to recover its type&lt;br /&gt;qsort2.hs:2:15-46&gt; seq x ()&lt;br /&gt;()&lt;br /&gt;qsort2.hs:2:15-46&gt; :p x&lt;br /&gt;x - 10&lt;br /&gt;&lt;/pre&gt;Once a breakpoint is hit, you can explore the bindings in scope, as well as to evaluate any haskell expression, as you would do in a normal GHCi prompt. The &lt;tt&gt;':print'&lt;/tt&gt; command can be very useful to explore the lazyness of your code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-115891520233044165?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/115891520233044165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=115891520233044165' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115891520233044165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115891520233044165'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/09/debugging-in-haskell.html' title='Debugging in Haskell'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-115687463798392479</id><published>2006-08-29T16:38:00.000+02:00</published><updated>2007-03-30T18:55:41.103+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='darcs'/><category scheme='http://www.blogger.com/atom/ns#' term='ghci_debugger'/><title type='text'>Darcs is broken</title><content type='html'>&lt;a href="http://www.darcs.net/logos/logo.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://www.darcs.net/logos/logo.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Darcs is broken. I found it out the hard way yesterday, while I was trying to commit my patches to the main trunk of GHC.&lt;br /&gt;Essentially, my patches were living in a separate branch. Of course the Darcs model does not need the concept of branches, as traditional SCMs do, but the analogy works fine here.&lt;br /&gt;The debugger is complete just in time for the 6.6 GHC release, and we were planning to include it in the candidate release yesterday Monday.&lt;br /&gt;&lt;br /&gt;But Darcs planned otherwise. While my patches were on a branch, I had been careful to keep this branch sync'ed to the main trunk. This means pulling patches from the main trunk once a week or so and fixing any conflicts with my code. Since my patches are spread around several subsystems in the compiler, conflicts have arisen three or four times during these three months.&lt;br /&gt;It turns out that since the last sync with the main trunk I did around the 22nd of August, a new patch has been commited which conflicts with my work. But this time Darcs has decided against simply doing the merge and calling conflict. Instead, it will diverge exponentially and hang.&lt;br /&gt;&lt;br /&gt;I have tried everything! I switched to Linux, to Windows, to older versions, I tried all sort of Darcs tricks... to no avail.&lt;br /&gt;&lt;br /&gt;What is more embarrassing, it turns out that this is a &lt;a href="http://darcs.net/DarcsWiki/ConfictMiseryAnalysis"&gt;well-known issue&lt;/a&gt; of Darcs, and looks like there is no hope for a solution&lt;a href="http://www.abridgegame.org/pipermail/darcs-users/2006-February/009645.html"&gt; in the near future&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So now what? The maintainers of the Ghc repo are aware of this Darcs issue, and they have sensibly requested me to avoid pushing patches with conflicts into the main repo. Which means I have to manually re-record all my patches, by hand (with help of diff/patch), into the main trunk. This could take me several evenings, and is boring as hell!&lt;br /&gt;Of course I could record a One Big Patch, but that's a less desirable solution.&lt;br /&gt;&lt;br /&gt;I wish I had known about this issue of Darcs before.&lt;br /&gt;I wish Darcs patch theory wasn't so broken in the first place.&lt;br /&gt;&lt;p style="text-align: right;"&gt;&lt;span style="font-size:10;"&gt;[posted with &lt;/span&gt;&lt;span style="font-size:10;"&gt;&lt;a href="http://ecto.kung-foo.tv/"&gt;ecto&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:10;"&gt;]&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-115687463798392479?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115687463798392479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115687463798392479'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/08/darcs-is-broken.html' title='Darcs is broken'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-115456056163912540</id><published>2006-08-03T01:04:00.000+02:00</published><updated>2007-03-30T18:54:00.902+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='soc'/><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><title type='text'>SoC demographic stats</title><content type='html'>The Google people &lt;a href="http://google-code-updates.blogspot.com/2006/08/google-summer-of-code-mid-term-report.html"&gt;have published&lt;/a&gt; some numbers about this year Summer of Code.&lt;br /&gt;&lt;br /&gt;I am still jaws open. Haskell.org is ranking above organizations such as The Mozilla Foundation, Eclipse or Ruby Central !!&lt;br /&gt;&lt;br /&gt;How would you interpret this?&lt;br /&gt;Could it perhaps be an indication that Haskell and FP in general is starting to become &lt;a href="http://www.joelonsoftware.com/items/2006/08/01.html"&gt;more popular among the masses&lt;/a&gt;, at least young masses?&lt;br /&gt;Or could it just mean that Haskell.org &lt;a href="http://hackage.haskell.org/trac/summer-of-code/query?status=new&amp;status=assigned&amp;amp;status=reopened&amp;group=topic&amp;amp;type=proposed-project&amp;amp;order=priority"&gt;project proposals&lt;/a&gt; were terrific  -they were, imho- and attracted a lot of minds?&lt;br /&gt;&lt;br /&gt;In one way or another it is awesome, and I am really thankful to all the people in Google and in Haskell.org who have made this possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-115456056163912540?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/115456056163912540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=115456056163912540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115456056163912540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115456056163912540'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/08/soc-demographic-stats.html' title='SoC demographic stats'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-115226267001132562</id><published>2006-08-01T10:54:00.000+02:00</published><updated>2007-03-30T18:53:23.510+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>Feather by feather</title><content type='html'>I bought me a white Macbook a few weeks ago and have been loving it since the first day. This is my first Apple box and I was a bit afraid that the transition would be time consuming, but I have actually enjoyed it.&lt;br /&gt;Some articles I recommend for tech-savvy people who are in the same situation - Macs are taking over the world &lt;a href="http://beust.com/weblog/"&gt;nowadays&lt;/a&gt; - is the awesome &lt;a href="http://arstechnica.com/articles/columns/mac.ars"&gt;Ars Technica collection&lt;/a&gt; of Mac Os reviews.&lt;br /&gt;Even though this has been a great experience and I am loving Mac Os - the hardware is good too, but nothing gets close to a Thinkpad - the system feels &lt;span style="font-weight: bold;"&gt;very slow&lt;/span&gt; most of the time. I use to have several applications running - Emacs, Mail, iTunes, Firefox, Terminal.App, Preview, Colloquy, Skype... - and a perennial ghc compilation process. I'm not sure if this is solely because of the limited amount of RAM the Macbook has (512 mb) or if this has to do with Mac Os 'universal cache'. I say this because it is especially noticeable when I launch a compilation session, often the system becomes totally unuseable - I cannot even type in a console-.&lt;br /&gt;&lt;br /&gt;So a major upgrade was in order. A new 7200 rpm hard drive and two 1gb sticks are arriving tomorrow, and I am getting ready for the migration. Sadly I can't use Tiger shiny Migration Assistant to help me, since &lt;a href="http://www.macdevcenter.com/pub/a/mac/2005/05/17/tiger.html?page=2"&gt;it requires two Macs&lt;/a&gt; and I only have one :S&lt;br /&gt;&lt;br /&gt;I'd loke to minimize the time used to install and setup the new hard drive, but also would like to do it from scratch in order to fix the beginner mistakes I have fall in, which include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;installing Stuffit, which is a PowerPC binary, will screw all the file associations for archive types&lt;/li&gt;&lt;li&gt;xompletely messy iTunes library&lt;/li&gt;&lt;li&gt;too many unix packages installed all around. I have used both fink and Darwin Ports, and it seems that a lot of hard drive space is wasted in overlapping base packages. Heck, I even went as far as to compiling amaRoK with fink (and all the base packages it requires!)&lt;/li&gt;&lt;li&gt;messy ghc installations all around&lt;/li&gt;&lt;li&gt;installing several softwares I didn't end up using&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The list below is a self note of all the things I have installed and I want to keep:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Carbon Emacs (my .emacs sets up Haskell mode, hippie-completion and a few other keystrokes)&lt;/li&gt;&lt;li&gt;Darcs + Darcsweb + setup my httpd &lt;/li&gt;&lt;li&gt;of course Firefox. Sure, I like the looks of Camino, but it is not clear to me why would I want to sacrifice all the available Firefox extensions&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Google Notebook + Google Sync + delicious Complete&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Missing Sync (demo). Otherwise, iCal will be useless for me.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Colloquy&lt;/li&gt;&lt;li&gt;Adium &lt;a href="http://forums.cocoaforge.com/viewtopic.php?t=8175&amp;start=45&amp;amp;"&gt;(with this fix)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Skype (webcam beta version)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Dashboard plugins:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Wikipedia&lt;/li&gt;&lt;li&gt;Sing that itune&lt;/li&gt;&lt;li&gt;laTele&lt;/li&gt;&lt;li&gt;cloudLicious&lt;/li&gt;&lt;li&gt;Airport Radar&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Spotlight plugins&lt;/li&gt;&lt;li&gt;iTunes plugins&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Synergy (demo)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;iScrobbler&lt;/li&gt;&lt;li&gt;iTunes Catalog (demo)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Textmate (demo)&lt;/li&gt;&lt;li&gt;XNJB proved pretty handy to manage my brother's Zen&lt;/li&gt;&lt;li&gt;Azureus, DivX&lt;/li&gt;&lt;li&gt;Omnigraffle, MindManager (demo)&lt;/li&gt;&lt;li&gt;Sleepless&lt;/li&gt;&lt;li&gt;TexShop + teTex (via fink)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;XCode tools + Apple X11&lt;/li&gt;&lt;li&gt;Virtue Desktops&lt;/li&gt;&lt;li&gt;UnrarX&lt;/li&gt;&lt;li&gt;rdekstop (via port)&lt;/li&gt;&lt;li&gt;Chicken of the vnc&lt;br /&gt;&lt;/li&gt;&lt;li&gt;subversion (via port)&lt;/li&gt;&lt;li&gt;Parallels -unbearably slow with this little memory-. I only need it to tinker with Visual Haskell&lt;/li&gt;&lt;li&gt;MacPython&lt;/li&gt;&lt;li&gt;Alarm Clock&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;That's all, and that's enough.&lt;br /&gt;This time the tribute is for Smog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-115226267001132562?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/115226267001132562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=115226267001132562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115226267001132562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115226267001132562'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/08/feather-by-feather.html' title='Feather by feather'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-115214313844179437</id><published>2006-07-06T01:26:00.001+02:00</published><updated>2010-03-24T13:11:30.699+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ghci_debugger'/><title type='text'>Post war</title><content type='html'>Oh no. Look at this. Almost one month without posting. Look at all you have missed! I feel your pain.&lt;br /&gt;&lt;br /&gt;I have been so busy working and coding that I completely forgot about my blog. That, or that I hate blogging. This is something that puzzles me. I love reading blogs, I know that. I especially love &lt;a href="http://www.cabochon.com/%7Estevey/blog-rants/"&gt;good writers&lt;/a&gt;, so maybe it's a problem of fear of comparison. Steve Yegge is a great writer. Much better than Paul Graham -I won't say sorry Steve, I know he is not reading this- . I especially dearly love the witches one, it reminds me of House. I've also been watching House a lot lately. Much better than the over hyped Lost or Prison Break if you ask me.&lt;br /&gt;&lt;br /&gt;But honestly, during this month I've been doing some work too. I have actually managed to put up &lt;a href="http://darcs.haskell.org/SoC/ghc.debugger/"&gt;some patches&lt;/a&gt; -sorry, you missed my 'first patch' post- and to get myself &lt;span style="text-decoration: underline;"&gt;exposed&lt;/span&gt;&lt;a href="http://www.haskell.org//pipermail/haskell-cafe/2006-July/016446.html"&gt; &lt;/a&gt;in the public -you missed that one too-. Don't worry, it is all neatly included in a very nice &lt;a href="http://haskell.org/haskellwiki/Ghci/Debugger"&gt;page at the haskell wiki&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;That last part is actually interesting. If you don't mind, since it took me a few minutes to compose it, I am going to call the holy powers of reuse and paste a nice info bit about the closure viewer from there.&lt;br /&gt;&lt;br /&gt;Currently it provides two new commands under ghci, :print and :sprint, both used in the same way as &lt;tt&gt;:type&lt;/tt&gt; or &lt;tt&gt;:info&lt;/tt&gt;. The latter prints a semievaluated closure using underscores to represent suspended computations (pretty much as [[Hood]] does). The former one in addition binds these thunks to variable names, so that you can do things with them.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Prelude&gt; let li = map Just [1..5]&lt;br /&gt;Prelude&gt; length li&lt;br /&gt;5&lt;br /&gt;Prelude&gt; :sp li&lt;br /&gt;li - _:_:_:_:_:[]&lt;br /&gt;&lt;br /&gt;Prelude&gt; head li&lt;br /&gt;Just 1&lt;br /&gt;&lt;br /&gt;Prelude&gt; :sp li&lt;br /&gt;li - Just 1:_:_:_:_:[]&lt;br /&gt;&lt;br /&gt;Prelude&gt; last li&lt;br /&gt;Just 5&lt;br /&gt;&lt;br /&gt;Prelude&gt; :sp li&lt;br /&gt;li - Just 1:_:_:_:Just 5:[]&lt;br /&gt;&lt;br /&gt;Prelude&gt; :p li&lt;br /&gt;li - Just 1 : (_t987::Maybe Integer) : (_t988::Maybe Integer) : (_t989::Maybe Integer) : [Just 5]&lt;br /&gt;&lt;br /&gt;Prelude&gt; _t987 `seq` ()&lt;br /&gt;&lt;br /&gt;Prelude&gt; :p li&lt;br /&gt;li - Just 1 : Just 2 : (_t457::Maybe Integer) : (_t458::Maybe Integer) : [Just 5]&lt;br /&gt;&lt;br /&gt;Prelude&gt; _t988&lt;br /&gt;Just 3&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Its best feature is that it can work without type information, so you can display polymorphic objects the type of which you don't know. However if there is type information available, it is used. It could be made totally independent of type info, so that it could work with opaque or coerced (wrong) types. For instance:&lt;br /&gt;&lt;br /&gt;&lt;haskell&gt;&lt;br /&gt;data Opaque = forall a. O a&lt;br /&gt;&lt;/haskell&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;*Test2&gt; let li = map Just [1..5]&lt;br /&gt;*Test2&gt; let o = O li&lt;br /&gt;*Test2&gt; head li `seq` ()&lt;br /&gt;*Test2&gt; length li `seq` ()&lt;br /&gt;*Test2&gt; :p o&lt;br /&gt;o - O Just 1 : (_t126::a) : (_t125::a) : (_t124::a) : (_t123::a) : []&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the example above the &lt;tt&gt;li&lt;/tt&gt; inside &lt;tt&gt;o&lt;/tt&gt; is not typed, so the bindings aren't either. However, it would be possible to extend the closure viewer so that it recovers its types.&lt;br /&gt;&lt;br /&gt;Other currently proposed extensions are a &lt;tt&gt;safeCoerce&lt;/tt&gt; function (not so useful, it depends on ghc-api) and an &lt;tt&gt;unsafeDeepSeq&lt;/tt&gt; (this one is decoupled from ghc-api). There is also a generally useful (for compiler/tool developers) &lt;tt&gt;isFullyEvaluated&lt;/tt&gt; query function. The signatures being:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;isFullyEvaluated :: a -&gt; IO Bool&lt;br /&gt;unsafeDeepSeq    :: a -&gt; b -&gt; b&lt;br /&gt;safeCoerce       :: GHC.Session -&gt; a -&gt; Maybe b&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's all for this one. Some of you people have been annoyed that my feeds are not working. Don't worry, I will be fixing them soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-115214313844179437?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/115214313844179437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=115214313844179437' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115214313844179437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/115214313844179437'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/07/post-war.html' title='Post war'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-114993644968959914</id><published>2006-06-10T12:31:00.000+02:00</published><updated>2007-03-30T18:56:28.500+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><category scheme='http://www.blogger.com/atom/ns#' term='ghci_debugger'/><title type='text'>Short Update</title><content type='html'>In the style of a fellow &lt;a href="http://cmarcelo.blogspot.com/2006/06/short-updates.html"&gt;Summer Haskeller&lt;/a&gt; I enumerate below my current headache sources.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;C-- &lt;/span&gt;I got two prim ops implemented in GHC, one is for retrieving the info table pointer of a closure and another to retrieve the payload. All in all, C-- coding withouth knowing C--&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Dealing with Pointers&lt;/span&gt; I've been reading the code from FPS to get a better idea of how to work with this kind of stuff. The payload of a closure is retrieved as a tuple consisting of an array of pointers (to other closures) and a bytearray.  Skimming through the FPS code (now called Data.ByteString) helped me a lot and now I got the bytearray side of the tuple sorted.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Debugging the beast&lt;/span&gt; Maybe in an exercise of naivety, I hoped to be able to complete the project withouth resorting to gdb. After all, it debugging the beast is well known to be &lt;a href="http://hackage.haskell.org/trac/ghc/wiki/DebuggingGhcCrashes"&gt;scary&lt;/a&gt;. The current situation is that if well the bytearray thing is working, I cannot say the same about the array of closure pointers. All I got for now are segfaults and no clue.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you want to know a bit more about what exactly I am working on, follow &lt;a href="http://www.haskell.org//pipermail/cvs-ghc/2006-April/029040.html"&gt;this discussion&lt;/a&gt; in the Glasgow Haskell Mailing List.&lt;br /&gt;&lt;br /&gt;On a side note, Simon Marlow has set up a Darcs repository at &lt;a href="http://darcs.haskell.org/summer-of-code/"&gt;darcs.haskell.org&lt;/a&gt; for the nine of us. I haven't still given it a thought, but probably I will have to branch the entire GHC repo in there. I'm not sure if that's the right thing to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-114993644968959914?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/114993644968959914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=114993644968959914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114993644968959914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114993644968959914'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/06/short-update.html' title='Short Update'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-114933730685241040</id><published>2006-06-03T13:44:00.000+02:00</published><updated>2006-06-03T20:37:24.983+02:00</updated><title type='text'>Bitten by rsync</title><content type='html'>My tool of work is a Thinkpad X31, an impressive machine which still does its job after three years of extreme use. I've tried to install Linux on it several times, but I always end up dual booting on Windows: I'm not buying the Linux laptop experience.&lt;br /&gt;&lt;br /&gt;Building GHC is an fairly complex process by itself, and setting the build process in Windows would probably be a nightmare. That's why I'm using a Linux box to build it. I make the modifications in my laptop and use Darcs to transfer them to the compilation box. Sounds ok.&lt;br /&gt;&lt;br /&gt;Now, the annoying part is that I often have to correct a few things in the code to fix the ubiquitous compilation errors, and I do that directly on the server (emacs through SSH is awesome). Then I amend the patch and get it back in my laptop (amend-unpull-pull) which is a royal pain. It is even worse now that compilation times are huge (usually they aren't, but I'm working in some prim ops now and that requires almost full recompilation). I find that I'm coding in my laptop while the box is compiling, and once the amended patch compiles and is tested, I get a lot of conflicts with the current changes when pulling it back to my laptop.&lt;br /&gt;&lt;br /&gt;So I seemingly have two options. Either 1) I do all the work in the server through SSH and Emacs, or 2) I do it all in my laptop. I'm not convinced by 1), and I have discarded Linux in my laptop and building GHC in Windows for 2).&lt;br /&gt;&lt;br /&gt;This morning I came up with the idea of using rsync to enable 2). I can do all the work in my laptop, including correcting compile errors, and rsync helps me to get almost instant feedback (modulo GHC compilation times). The good thing of this is that I can avoid producing incorrect patches which I have to amend every time, and avoid the conflicts I get when pulling them back.&lt;br /&gt;&lt;br /&gt;Well, so far the experiment has been a disaster. I wanted to go safe, so I took my time to read a few tutorials on rsync, the man page, set up a rsync server in my build box, carefully set the appropiate filters to synchronize only the appropiate extensions (hs,lhs,c,h,cmm..), exclude the _darcs directory and so on.... A few dry runs after and everything seems to be all right, so I jump and launch the actual thing.&lt;br /&gt;ZAP! In a second I've lost two hours of work in my laptop because turns out I used rsync in the inverse direction, i.e. overwriting the files in my laptop with the files in the building box. And yes, dumb as I am I hadn't recorded those changes in a Darcs patch beforehand, and there is no way to restore them back.&lt;br /&gt;&lt;br /&gt;I can redo that work in a few minutes, it's not a big deal, but right now I feel dumb and pissed!&lt;br /&gt;&lt;br /&gt;UPDATE: I got it right at last, and now it is working beautifully. I've setup a two lines script allowing me to do the whole cycle edit -&gt; compile -&gt; edit ... from my side. Another handy trick for doing that was the ssh feature for sending a command remotely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-114933730685241040?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/114933730685241040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=114933730685241040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114933730685241040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114933730685241040'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/06/bitten-by-rsync.html' title='Bitten by rsync'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-114881593077498128</id><published>2006-05-28T13:17:00.000+02:00</published><updated>2006-05-28T13:33:34.696+02:00</updated><title type='text'>A first tiny step</title><content type='html'>Yesterday night I managed to do it: modify the beast, compile, and test my changes!&lt;br /&gt;&lt;br /&gt;The goal was to obtain the closure type of a HValue, the internal datatype representing linked BCOs (bytecode objects) used by ghci. It was a bit annoying to get there, because it involved&lt;br /&gt;&lt;ul&gt;&lt;li&gt;unsafeCoerce# (aka the Blunt Instrument)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;fiddling with pointers&lt;/li&gt;&lt;li&gt;and going down to C-land. &lt;/li&gt;&lt;/ul&gt;But it was actually a piece of cake!&lt;br /&gt;&lt;br /&gt;Visit &lt;a href="http://ender4.dsic.upv.es:81/cgi-bin/darcsweb.cgi?r=ghcfull;a=summary"&gt;my darcs repository&lt;/a&gt; if you want to see &lt;a href="http://ender4.dsic.upv.es:81/cgi-bin/darcsweb.cgi?r=ghcfull;a=commit;h=20060528095321-8a49a-18d21d76f124011a547a47054340581f70199f1d.gz"&gt;the code&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-114881593077498128?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/114881593077498128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=114881593077498128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114881593077498128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114881593077498128'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/05/first-tiny-step.html' title='A first tiny step'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-114875837048046650</id><published>2006-05-27T21:13:00.000+02:00</published><updated>2006-05-28T00:01:46.850+02:00</updated><title type='text'>I should be coding ...</title><content type='html'>...instead of posting here, but I guess I can use a few minutes to briefly introduce the SoC project I am working on.&lt;br /&gt;&lt;br /&gt;Haskell is a beautiful, lazy functional programming language, and &lt;a href="http://www.haskell.org/ghc"&gt;GHC &lt;/a&gt;is its compiler. We (that's me and my headache) are working in a easy to use, simple, bare to the bones debugger based on GHC, or GHC-interactive to be more specific. How come there isn't a debugger for Haskell yet?&lt;br /&gt;&lt;br /&gt;Well, of course there are debuggers, and they are far more advanced than the one we are aiming at. See for instance the &lt;a href="http://www.haskell.org/hat"&gt;Hat &lt;/a&gt;tracer. The main problem is that they are outdated, since they cannot keep up with the evolutional speed of Haskell. Haskell 98 is the standard, but every new version of GHC sets the current status of the language, implementing several (lots of) experimental extensions. Haskell research community is enormously active.&lt;br /&gt;&lt;br /&gt;As a result, you are restricted to a (bigger or smaller) subset of the language if you want to use one of these debuggers. Our goal is to build on top of the very own GHC machinery so that our debugger will never restrict you or get outdated. And to keep it simple.&lt;br /&gt;&lt;br /&gt;Wish us good luck :)&lt;br /&gt;(ok, I swear the jokes about my headache end here)&lt;br /&gt;&lt;br /&gt;PS: Just to clarify, the debugger is not to my credit. I am only doing on a tiny part, building on top of the work of David Himmelstrup, my mentor (poor soul).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-114875837048046650?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/114875837048046650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=114875837048046650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114875837048046650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114875837048046650'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/05/i-should-be-coding.html' title='I should be coding ...'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-114862623218731493</id><published>2006-05-26T08:43:00.000+02:00</published><updated>2006-05-26T21:10:39.780+02:00</updated><title type='text'>A Hell of a week</title><content type='html'>This one was an all around shiny week which started all wrong. On Monday I had a pretty serious bike accident. In fact I can't remember anything about it: I hit my backhead hard on the ground and lost my conscience for a few seconds. Luckily there were gentle peasants around to help me, and I managed to regain my feet with a few bruises, an almost-broken rib and sore knees.&lt;br /&gt;Because of the head trauma I was feeling some strong dizziness periods, so I have spent some time in the hospital passing tests, until yesterday they found that all I have &lt;a href="http://www.tchain.com/otoneurology/disorders/bppv/bppv.html"&gt;is this&lt;/a&gt;. Phew! Good to know that my brain survived! (though it is the same brain that had a stupid bike accident on Monday in the first place)&lt;br /&gt;&lt;br /&gt;On Wednesday morning, before my bike was stolen some hours later, I got accepted for Google &lt;a href="http://code.google.com/soc/"&gt;Summer of Code&lt;/a&gt;, on a very interesting project for Haskell. La ostia! The funny thing is that many people in my research group found it out before than myself, reading it in a post to the Haskell list. It rocks to have this sort of group mates!&lt;br /&gt;I'm a bit scared with the perspective, because until I get some vacation time in July  time will have to be shared between work on SoC, PhD courses and PhD work, so it is going to be a tight schedule.&lt;br /&gt;&lt;br /&gt;On another topic entirely, my dad is progressing well with Rails. It's an impressive feat (for an old man like my dad ;) ) that in only one month he is speaking Rails fluently, considering that beforehand, he knew nothing about HTML, CSS, Javascript, and the entire web development problem. I'm lucky to be a percent as smart as he is. Also, he just admitted that diving through the Rails sources has helped him immensely. He is starting to appreciate the whole point of open source, and for an old man like him who used to deny OSS, that's a huge accomplishment.&lt;br /&gt;&lt;br /&gt;That was all. Not bad for a first post. I will try to post at least an update a week, though I know beforehand that's an empty promise.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-114862623218731493?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/114862623218731493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=114862623218731493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114862623218731493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/114862623218731493'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2006/05/hell-of-week.html' title='A Hell of a week'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19751422.post-113425057306880169</id><published>2005-12-10T18:14:00.001+01:00</published><updated>2006-05-26T08:43:28.973+02:00</updated><title type='text'>Here I am</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/4793/1961/1600/IMG_5964.jpg"&gt;&lt;img style="margin: 0px 10px 10px 0px; float: left;" alt="" src="http://photos1.blogger.com/blogger/4793/1961/400/IMG_5964.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That's me with a funny face, in a fencing suit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19751422-113425057306880169?l=pepeiborra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pepeiborra.blogspot.com/feeds/113425057306880169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19751422&amp;postID=113425057306880169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/113425057306880169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19751422/posts/default/113425057306880169'/><link rel='alternate' type='text/html' href='http://pepeiborra.blogspot.com/2005/12/here-i-am.html' title='Here I am'/><author><name>Pepe Iborra</name><uri>http://www.blogger.com/profile/18294801014514561748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
