<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>A Blog by Roman Gonzalez.-</description><title>Thoughts Heap</title><generator>Tumblr (3.0; @romanandreg)</generator><link>http://blog.romanandreg.com/</link><item><title>Vancouver's Clojure Club is ALIVE!</title><description>&lt;a href="http://van-clj.github.com"&gt;Vancouver's Clojure Club is ALIVE!&lt;/a&gt;: &lt;p&gt;Some friends and myself decided to formalize a study group we were having for learning Clojure, at this point I think there is enough people that could comfortably work on open source projects. &lt;/p&gt;

&lt;p&gt;The idea is to join and share projects as a group to gain more feedback from others, this way if a group checks and uses the libraries instead of individuals this libraries will definitely get more traction. &lt;/p&gt;

&lt;p&gt;Hopefully this initiative will bring really great OS projects to life.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/16876056397</link><guid>http://blog.romanandreg.com/post/16876056397</guid><pubDate>Wed, 01 Feb 2012 12:10:23 -0800</pubDate></item><item><title>"Most of the biggest problems in software are problems of misconception."</title><description>“Most of the biggest problems in software are problems of misconception.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Rich Hickey.&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/13639581489</link><guid>http://blog.romanandreg.com/post/13639581489</guid><pubDate>Fri, 02 Dec 2011 09:57:43 -0800</pubDate><category>clojure</category><category>software</category></item><item><title>Haskell's Show and pretty printing bad practice</title><description>&lt;p&gt;Most of times when I was coding Haskell code, I always implemented the &lt;code&gt;Show&lt;/code&gt; classtype whenever I wanted to print things on the screen in a nice and fashionable way.&lt;/p&gt;

&lt;p&gt;It seems however this is a &lt;strong&gt;really bad practice&lt;/strong&gt; that hasn’t been taught enough in the Haskell community.  I discovered this &lt;a href="http://stackoverflow.com/questions/8217511/haskell-show-and-pretty-print-instance/8217647#comment10104265_8217647" target="_blank"&gt;in a StackOverflow question&lt;/a&gt; that had nothing to do with pretty printing, but the discussion led to that&lt;a href="#note1" target="_blank"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A user named &lt;a href="http://stackoverflow.com/users/894284/matt-fenwick" target="_blank"&gt;Matt Fenwick&lt;/a&gt; suggested that for whatever reason the guy who asked the question shouldn’t implement the &lt;code&gt;Show&lt;/code&gt; classtype, later on I started to comment:&lt;/p&gt;

&lt;div style="border: 1px solid #DDD; padding: 12px;"&gt;
&lt;p&gt;&lt;strong&gt;Me:&lt;/strong&gt; Why not declare Show classtype for the Expr? just curious?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;hammar:&lt;/strong&gt; Show is meant as a form of lightweight serialization. It’s not meant for pretty-printing, although people often abuse it that way. In particular, if a Read instance is also defined, one should be able to expect that read . show is the identity function.&lt;/p&gt;


&lt;/div&gt;

&lt;p&gt;After that realization, I went out and looked over for different pretty printing solutions in Haskell. This was quite frustrating, for some reason I didn’t find any library that would define pretty printing functions for basic containers like &lt;code&gt;List&lt;/code&gt;, &lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;Map&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The closest I’ve found to an &lt;em&gt;out of the box&lt;/em&gt; pretty printing solution  was the &lt;a href="http://hackage.haskell.org/packages/archive/pretty-show/1.1/doc/html/Text-Show-Pretty.html" target="_blank"&gt;pretty-show&lt;/a&gt; package. However this doesn’t create a new classtype for pretty printing, making it really limiting IMO.&lt;/p&gt; 

&lt;p&gt;There is also the well established &lt;a href="http://hackage.haskell.org/packages/archive/pretty/1.1.0.0/doc/html/Text-PrettyPrint.html" target="_blank"&gt;pretty&lt;/a&gt; package, This one provides combinators to create pretty printing functions easily, however, it doesn’t provide a classtype or a default implementation for the containers mentioned above.&lt;/p&gt;

&lt;p&gt;Lastly the most promising package I’ve found is called &lt;a href="http://hackage.haskell.org/package/GenericPretty-1.1.9" target="_blank"&gt;GenericPretty&lt;/a&gt;. This one provides a classtype for pretty printing and implements some Prelude ADT, however no containers whatsoever and no combinators for generating pretty printing.&lt;/p&gt;

&lt;p&gt;In conclusion, the pretty printing solutions are &lt;em&gt;so, so&lt;/em&gt;… yet there is potential for something new raising up in the future.&lt;/p&gt;

&lt;hr&gt;&lt;p&gt;&lt;sup id="note1"&gt;1&lt;/sup&gt; | Because of this the title was later changed to Show and Pretty-Printing&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/13545420287</link><guid>http://blog.romanandreg.com/post/13545420287</guid><pubDate>Wed, 30 Nov 2011 06:02:06 -0800</pubDate><category>haskell</category><category>practices</category><category>pretty-print</category></item><item><title>Clojure's repeatedly gotcha</title><description>&lt;p&gt;When using Clojure’s &lt;code&gt;repeatedly&lt;/code&gt; function to read lines from a terminal, or when trying to do IO of some sort, the behavior won’t be as expected&lt;/p&gt;

&lt;p&gt;This is because &lt;code&gt;repeatedly&lt;/code&gt; instead of calling the action n times, it generates a lazy seq for each time the action function gets called. Given that &lt;strong&gt;it is a lazy seq&lt;/strong&gt;, if you don’t force the evaluation of the list,  all but the first element will not be executed.&lt;/p&gt;

&lt;p&gt;In order to avoid this, you have to use the &lt;code&gt;dorun&lt;/code&gt; function, this is going to force evaluation for each element on a lazy seq, and it will discard the result of the seq altogether, this is because this function is expecting the action body to be for side-effects only&lt;/p&gt; 

&lt;p&gt;if you come from Haskell land, the idiom &lt;code&gt;(dorun (repeatedly n body-fn))&lt;/code&gt; would be the equivalent to call the function &lt;code&gt;repeatM_&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An example:&lt;/p&gt;

&lt;script src="http://gist.github.com/1398844.js?file=example.clj"&gt;&lt;/script&gt;</description><link>http://blog.romanandreg.com/post/13454376796</link><guid>http://blog.romanandreg.com/post/13454376796</guid><pubDate>Mon, 28 Nov 2011 07:05:00 -0800</pubDate><category>clojure</category><category>gotcha</category></item><item><title>Vim's Fugitive's "Error detected while processing function &lt;SNR&gt;51_Commit"</title><description>&lt;p&gt;At a random time on my development cycle, I was using the awesome &lt;a href="https://github.com/tpope/vim-fugitive" target="_blank"&gt;Fugitive plugin&lt;/a&gt; developed by &lt;a href="http://twitter.com/tpope" target="_blank"&gt;Tim Pope&lt;/a&gt;, and I got the following strange error:&lt;/p&gt;

&lt;br/&gt;&lt;pre&gt;&lt;code&gt;
Error detected while processing function &lt;snr&gt;51_Commit:
line   52:
E480: No match: `=msgfile`
Press ENTER or type command to continue
&lt;/snr&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;br/&gt;&lt;p&gt;After some googling, I found out the reason was that I installed just a few days ago the also awesome &lt;a href="http://github.com/kien/ctrlp.vim" target="_blank"&gt;ctrlp plugin&lt;/a&gt;. When you were setting up ctrlp, you did something like this:&lt;/p&gt;

&lt;br/&gt;&lt;pre&gt;&lt;code&gt;
set wildignore=*/.git/*,*/.hg/*,*/dist/*,*/cabal-dev/*
&lt;/code&gt;&lt;/pre&gt;

&lt;br/&gt;&lt;p&gt;Well… it seems Fugitive plugin doesn’t like that very much, if you remove the git portion from that setting, Fugitive will work as expected again&lt;/p&gt;

&lt;p&gt;Thanks &lt;a href="https://github.com/tpope/vim-fugitive/issues/119" target="_blank"&gt;Interwebz&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/12541973840</link><guid>http://blog.romanandreg.com/post/12541973840</guid><pubDate>Tue, 08 Nov 2011 19:01:00 -0800</pubDate><category>vim</category><category>gotcha</category></item><item><title>"The distinction between mechanism and policy is one of the best ideas behind the Unix design. Most..."</title><description>“The distinction between mechanism and policy is one of the best ideas behind the Unix design. Most programming problems can indeed be split into two parts: “what capabilities are to be provided” (the mechanism) and “how those capabilities can be used” (the policy). If the two issues are addressed by different parts of the program, or even by different programs altogether, the software package is much easier to develop and to adapt to particular needs.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Jonathan Corbet, Greg Kroah-Hartman, Alessandro Rubini on &lt;a href="http://makelinux.com/ldd3/" target="_blank"&gt;Linux Device Drivers, 3rd Edition&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/11921688149</link><guid>http://blog.romanandreg.com/post/11921688149</guid><pubDate>Tue, 25 Oct 2011 14:52:54 -0700</pubDate><category>unix</category></item><item><title>chiguire:

tejemaneje:

Dennis Ritchie has just passed...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lszgcmeSjH1qzg42qo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://blog.ciroduran.com/post/11395164055" class="tumblr_blog" target="_blank"&gt;chiguire&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;a href="http://tejemaneje.tumblr.com/post/11381099183" target="_blank"&gt;tejemaneje&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Dennis Ritchie has just passed away.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Surely you probably don’t know who this guy is, but his contributions to computer science made your life what it is right now.&lt;/p&gt;
&lt;p&gt;Among other things, he created C, a programming language which is used to create all sort of OS and aplication software these days (and it will be that way in the future), and was key in the development of other important programming languages that came before. C made possible software as you know it.&lt;/p&gt;
&lt;p&gt;Also, C was fundamental in the development of Unix, a OS that (one way or another) led to Linux. If you don’t want to mess with the Open Source / Licensed Software dilemma, keep in mind that Linux (and the Open Source movement in general) is a powerful engine that moves science and research nowadays.&lt;/p&gt;
&lt;p&gt;In one week exactly the world has lost two of the greatest contributors in computer science. One dedicated to design, one dedicated to programming.&lt;/p&gt;
&lt;p&gt;Maybe, if you allow me to put it that way, it is life saying us that both things are equally important.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Lo recordaremos hasta 2038.&lt;/p&gt;&lt;/blockquote&gt;



&lt;p&gt;Another Great One has gone…&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/11403694134</link><guid>http://blog.romanandreg.com/post/11403694134</guid><pubDate>Thu, 13 Oct 2011 12:43:14 -0700</pubDate></item><item><title>Rest in peace dude… Thanks for the ride. Great men leave...</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_lsmbkvLmHW1qzxe9uo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Rest in peace dude… Thanks for the ride. Great men leave young.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/11080317939</link><guid>http://blog.romanandreg.com/post/11080317939</guid><pubDate>Wed, 05 Oct 2011 17:19:41 -0700</pubDate></item><item><title>Testing URI canonicalization using QuickCheck</title><description>&lt;p&gt;Today I was working on a custom web crawler for the company I’m working in. One of the problems I was having in the first implementations was that I was not &lt;em&gt;canonicalizing&lt;/em&gt; the links, and I was visiting the same link more than once in the crawl.&lt;/p&gt;

&lt;p&gt;Canonicalization of URI’s basically consist on removing any query string and fragment out of the given URI (at least, that is my understanding of canonicalization).&lt;/p&gt;

&lt;p&gt;I needed to test a function that was doing the canonicalization of links, and decided to use a QuickCheck property to check just that. I implemented an Arbitrary instance for a pair of URI Strings, so that I could get the canonicalized version and a version with a query string and/or fragment, and compare the two after the canonicalization algorithm I developed.&lt;/p&gt;

&lt;p&gt;The following code shows the Arbitrary instance of a newtype called URIPair&lt;/p&gt; 

&lt;br/&gt;&lt;script src="http://gist.github.com/1252086.js?file=ArbitraryInstances.hs"&gt;&lt;/script&gt;&lt;br/&gt;&lt;p&gt; The next one shows how this is being used in a QuickCheck property test&lt;/p&gt;

&lt;br/&gt;&lt;script src="http://gist.github.com/1252086.js?file=QuickCheckTest.hs"&gt;&lt;/script&gt;&lt;br/&gt;&lt;p&gt;Finally the Main action&lt;/p&gt;

&lt;br/&gt;&lt;script src="https://gist.github.com/1252086.js?file=TestSuite.hs"&gt;&lt;/script&gt;&lt;br/&gt;&lt;p&gt;By using the Gen monad combinators, and a newtype for URIs, I was able to implement in around 50 LOC, a generator for both canonicalized and normal links.&lt;/p&gt;

&lt;p&gt;I’m still believing there must be a more elegant and shorter way to do this, or maybe I could reuse some code on Arbitrary instances for URIs, sadly no luck so far.&lt;/p&gt;

&lt;p&gt; If you are Haskell developer yourself and want to provide insights, please fork the gist and show us how this can be done in a better way.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/10821976145</link><guid>http://blog.romanandreg.com/post/10821976145</guid><pubDate>Thu, 29 Sep 2011 15:21:00 -0700</pubDate><category>Haskell</category><category>QuickCheck</category><category>URI</category></item><item><title>Puppet: ERROR 400 on SERVER: Must pass 'param-name' to Class['class-name']</title><description>&lt;p&gt;I’m currently playing with puppet doing some changes to my modules to support Archlinux, at this time I did several changes to my git module, Initially the implementation was something like this:&lt;/p&gt;

&lt;script src="https://gist.github.com/1238454.js?file=git1.pp"&gt;&lt;/script&gt;&lt;p&gt;And then, it became something like this:&lt;/p&gt;

&lt;script src="https://gist.github.com/1238454.js?file=git2.pp"&gt;&lt;/script&gt;&lt;p&gt;In the end I added some new parameters to my git class, and changed my nodes.pp file accordingly:&lt;/p&gt;

&lt;script src="https://gist.github.com/1238454.js?file=nodes1.pp"&gt;&lt;/script&gt;&lt;p&gt;For some crazy reason, the puppet agent was throwing me the following error:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;err: Could not retrieve catalog from remote server: Error 400 on SERVER: Must pass user to Class[Git] at /etc/puppet/modules/git/manifests/init.pp:1 on node vagrantup.dev&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which was pretty annoying, given that I was passing all the parameters that the module was asking for. After two hours of trying in and out, reading documentation, doing magic incantations, etc. I decided to do this to my nodes.pp manifest file:&lt;/p&gt;

&lt;script src="https://gist.github.com/1238454.js?file=nodes2.pp"&gt;&lt;/script&gt;&lt;p&gt;That miraculously  solved the problem,  &lt;strong&gt;Class inclusion order is important, even if the documentation doesn’t say so&lt;/strong&gt;. This is as in puppet 2.7.3&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/10568428465</link><guid>http://blog.romanandreg.com/post/10568428465</guid><pubDate>Fri, 23 Sep 2011 14:16:00 -0700</pubDate><category>puppet</category><category>gotcha</category></item><item><title>"Don’t, Please ***don’t*** install puppet 2.7.3 with Ruby 1.9.2 ever, a freaking..."</title><description>“Don’t, Please ***don’t*** install puppet 2.7.3 with Ruby 1.9.2 ever, a freaking afternoon can be spent on that!”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;Me.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="http://urgetopunt.com/puppet/2011/09/14/puppet-ruby19.html" target="_blank"&gt;this guy&lt;/a&gt; for pointing me in the right direction.&lt;/p&gt;

&lt;p&gt;Stupid puppet and stupid ruby 1.9.2&lt;/p&gt;&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/10538553117</link><guid>http://blog.romanandreg.com/post/10538553117</guid><pubDate>Thu, 22 Sep 2011 17:30:00 -0700</pubDate><category>puppet</category><category>bugs</category></item><item><title>Loading package double-conversion- ... &lt;command line&gt;: can't load .so/.DLL for: stdc++ (libstdc++.so: cannot open shared object file: No such file or directory)</title><description>&lt;p&gt;Recently I’ve been playing with the aeson library in Ubuntu oneiric, unfortunately I ran across this compilation error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
Loading package double-conversion-0.2.0.1 ... &lt;command line&gt;: can't load .so/.DLL for: stdc++ (libstdc++.so: cannot open shared object file: No such file or directory)
&lt;/command&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After a lot of investigation, I found &lt;a href="http://hackage.haskell.org/trac/ghc/ticket/5289" target="_blank"&gt;a ticket on the Ttrac site of GHC&lt;/a&gt; that came up with a solution, I will summarize here so you don’t have to read the ticket yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;hvr:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are on a Ubuntu-like distribution and don’t mind exposing libstdc++.so you can link, you could symlink it to /usr/local/lib, e.g.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
$ ln -vs $(gcc --print-file-name=libstdc++.so) /usr/local/lib/
`/usr/local/lib/libstdc++.so' -&gt; `/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.so'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;basvandijk:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Note to others: I needed to do a&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo ldconfig&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;after this to update my cache&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/10470885637</link><guid>http://blog.romanandreg.com/post/10470885637</guid><pubDate>Tue, 20 Sep 2011 20:52:00 -0700</pubDate><category>Haskell</category><category>aeson</category><category>bug</category><category>ubuntu</category></item><item><title>Crawler implementation in Haskell</title><description>&lt;p&gt;Today at &lt;a href="http://www.noomii.com" target="_blank"&gt;Noomii&lt;/a&gt; I was getting some new requirements for our crawler that is implemented in Ruby. The requirement list was quite dense, and I was wondering if it was a good idea to implement this functionality in Haskell :-). &lt;/p&gt;

&lt;p&gt;Later, after finishing the morning scrum meeting, I got my hands on &lt;a href="http://bos.github.com/strange-loop-2011/slides/" target="_blank"&gt;Bryan O’Sullivan’s slides from the StrangeLoop conference&lt;/a&gt;, I was really interested in checking them out, given that I’m looking for better approaches to teach Haskell myself at the &lt;a href="http://www.unmeetup.com/" target="_blank"&gt;Vancouver unMeetup&lt;/a&gt;. What a surprise when I see an implementation of a Crawler on the presentation, the timing is so perfect it just makes me wonder is &lt;em&gt;fate&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If you are a Haskell &lt;em&gt;aficionado&lt;/em&gt; you will find this presentation pretty entertaining &lt;/p&gt;

&lt;p&gt;When you know you like a language, you just know…&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/10408867217</link><guid>http://blog.romanandreg.com/post/10408867217</guid><pubDate>Mon, 19 Sep 2011 11:34:15 -0700</pubDate><category>Haskell</category><category>Strangeloop</category><category>Slides</category><category>Fate</category></item><item><title>Aníbal Rojas: Como ser un mejor programador (un guía libre de pendejadas)</title><description>&lt;a href="http://anibal.rojas.com.ve/post/10384519398"&gt;Aníbal Rojas: Como ser un mejor programador (un guía libre de pendejadas)&lt;/a&gt;: &lt;p&gt;&lt;a href="http://anibal.rojas.com.ve/post/10384519398" class="tumblr_blog" target="_blank"&gt;anibalrojas&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Yo no soy un gram programador, creo que nunca lo he sido, aunque por mucho años me dedicara a programar profesionalmente. No me entiendan mal, no es que no me guste programar ni que mi código apestte, en realidad me gusta mucho y he tenido muy buenos momentos programado, pero el trabajo no me deja…&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Great post by one of my menthors back in Venezuela, hopefully at some point he will translate it.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/10389472220</link><guid>http://blog.romanandreg.com/post/10389472220</guid><pubDate>Sun, 18 Sep 2011 19:29:46 -0700</pubDate><category>programador</category><category>programación</category><category>excelencia</category><category>desarrollador</category><category>software</category></item><item><title>"Elegance and familiarity are orthogonal"</title><description>“Elegance and familiarity are orthogonal”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;Rich Hickey (author of Clojure)&lt;/p&gt;

&lt;p&gt;Meaning: Unless you are familiar with a concept/language etc, you are not able to tell if something is elegant or not.&lt;/p&gt;&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/10372759155</link><guid>http://blog.romanandreg.com/post/10372759155</guid><pubDate>Sun, 18 Sep 2011 13:25:26 -0700</pubDate></item><item><title>"All the adversity I’ve had in my life, all my troubles and obstacles, have strengthened..."</title><description>“All the adversity I’ve had in my life, all my troubles and obstacles, have strengthened me… You may not realize it when it happens, but a kick in the teeth may be the best thing in the world for you.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;Walt Disney.&lt;/p&gt;

&lt;p&gt;Personal note: On the hardest times, just remember this.&lt;/p&gt;&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/10300360645</link><guid>http://blog.romanandreg.com/post/10300360645</guid><pubDate>Fri, 16 Sep 2011 19:32:17 -0700</pubDate></item><item><title>Using and Parsing Dates in Haskell</title><description>&lt;p&gt;Recently I’ve been playing around with the Github API, and I wanted to do some code using Haskell. I’ve been using several libraries like &lt;a href="http://hackage.haskell.org/package/aeson" target="_blank"&gt;aeson&lt;/a&gt;, &lt;a href="http://hackage.haskell.org/package/enumerator" target="_blank"&gt;enumerator&lt;/a&gt;, &lt;a href="http://hackage.haskell.org/package/http-enumerator" target="_blank"&gt;http-enumerator&lt;/a&gt;, among others.&lt;/p&gt;

&lt;p&gt;One of the details I was really concerned about was the time structures in Haskell, I didn’t know exactly which module to use, and there were at least two options:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="http://hackage.haskell.org/packages/archive/old-time/latest/doc/html/System-Time.html" target="_blank"&gt;System.Time&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://hackage.haskell.org/packages/archive/time/latest/doc/html/Data-Time-Clock.html" target="_blank"&gt;Data.Time.Clock&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;After investigating a little bit about each, I settled down with Data.Time.Clock. The main reason to use it, was because this is the lib that Bryan O’Sullivan uses in his &lt;a href="http://hackage.haskell.org/package/aeson" target="_blank"&gt;aeson&lt;/a&gt; library, and by seeing how he used it, I discovered how to parse dates from Strings easily in Haskell; using the &lt;a href="http://hackage.haskell.org/packages/archive/time/latest/doc/html/Data-Time-Format.html" target="_blank"&gt;Data.Time.Format&lt;/a&gt;, one has utility methods to parse strings into UTCTime. I did some handy code to parse the dates out of the Github api like so:

&lt;script src="http://gist.github.com/1223527.js?file=GithubDate.hs"&gt;&lt;/script&gt;

I really recommend reading the  &lt;a href="http://hackage.haskell.org/package/aeson" target="_blank"&gt;aeson&lt;/a&gt; library, is one of a kind. &lt;/p&gt;</description><link>http://blog.romanandreg.com/post/10299475914</link><guid>http://blog.romanandreg.com/post/10299475914</guid><pubDate>Fri, 16 Sep 2011 19:10:39 -0700</pubDate><category>haskell</category><category>dates</category><category>parsing</category></item><item><title>Do yourself a favor...</title><description>&lt;p&gt;Never compile ghc-platform… ever, it took me around 12 hours to finish compilation, not fun at all.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/9557548750</link><guid>http://blog.romanandreg.com/post/9557548750</guid><pubDate>Mon, 29 Aug 2011 14:02:19 -0700</pubDate></item><item><title>Adrian Bravo's tumblr: Creating a Vagrant Base Box for Ubuntu</title><description>&lt;a href="http://adrianbravo.tumblr.com/post/644860401"&gt;Adrian Bravo's tumblr: Creating a Vagrant Base Box for Ubuntu&lt;/a&gt;: &lt;p&gt;This is for me so that I don’t forget how to build vagrant boxes again…&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/9557296971</link><guid>http://blog.romanandreg.com/post/9557296971</guid><pubDate>Mon, 29 Aug 2011 13:55:34 -0700</pubDate><category>code</category></item><item><title>"Any fool can write code that computers can understand. Good programmers write code that humans can..."</title><description>“Any fool can write code that computers can understand. Good programmers write code that humans can understand”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;img src="http://www.maniact.com/Ebay/Images_T-shirts/B.A.%20I%20Pity%20you%20Fool%20Baracus%20A-Team_small.gif"/&gt;&lt;br/&gt;
Martin Fowler (via &lt;a href="http://edgar.gonzalez.net.ve/" target="_blank"&gt;edgar&lt;/a&gt;)&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/9338708929</link><guid>http://blog.romanandreg.com/post/9338708929</guid><pubDate>Wed, 24 Aug 2011 10:23:00 -0700</pubDate><category>programming</category><category>fools</category></item></channel></rss>

