I have been doing some python brush-up over the last couple of days, and came across the following bit of code in an irc chat about approaches for fibonacci in python. def fib(n): a, b = 0, 1 for _ in xrange(n): a, b = b, a + b return a print fib(1000) I think [...]
Archive for the ‘Uncategorized’ Category
Transliterating python to haskell: Fibonacci in the state monad
Posted in Uncategorized on December 7, 2009 | 13 Comments »
Clearing up loose ends
Posted in Uncategorized on December 2, 2009 | Leave a Comment »
Patch-Tag is getting closer to a place where I’d feel comfortable charging for it, but there are a couple of things I need to take care of first. First, I want to be more confident that I can scale this service out if I start getting a lot more users. It needs to be rock [...]
Parting is such sweet sorrow
Posted in Uncategorized on November 3, 2009 | Leave a Comment »
I’m keeping this one brief… Matt Elder has decided that it’s time to move on from patch-tag, in order to focus on other projects and the new addition to his family. Thanks for all the good work, Matt. Patch-tag wouldn’t have gotten this far without you.
migrating from happstack 0.1 to happstack 0.3
Posted in Uncategorized on October 30, 2009 | 1 Comment »
I am in the process of migrating patch-tag to the latest version of happstack, and I thought I would post some diffs to aid others who have the same task. This probably isn’t of much interest unless you are actually faced with a migration — but if you are, could save you some time and [...]
Prelude golf: what can we learn by rewriting the partition function?
Posted in Uncategorized on October 28, 2009 | 4 Comments »
To get the most out of the following blog post, first try writing your partition function, which does the same thing as Data.List.partition. *Partition> partition even [1..10] ([2,4,6,8,10],[1,3,5,7,9]) Then write a testing function, tpf, which checks your partition function against a variety of input, including large or infinite input. (Which means we don’t just use [...]
haskell refactoring technique for naughty house elves: make it compile by making it undefined
Posted in Uncategorized on October 26, 2009 | 3 Comments »
It is said that in haskell, If it Compiles, It Works. This is true, but what do you do when it won’t compile? I came across a real world scenario for this just now, when I was in the process of removing the HStringTemplateHelpers dependency from happs tutorial. The reason for this is that HStringTemplateHelpers [...]
cabal install a package with local haddock documentation
Posted in Uncategorized on October 23, 2009 | 3 Comments »
I wanted to have a look at the latest happstack release, and noticed the documentation still wasn’t available on haddock. http://hackage.haskell.org/package/happstack It wasn’t available locally either, when I did cabal install happstack-server. In fact, haddock was not available offline for anything. To get the haddocks locally, I edited ~/.cabal/config, setting Documentation: True (and uncommenting that [...]
Patch-Tag is now darcs send friendly for mailing patches to repo owner
Posted in Uncategorized on October 14, 2009 | 4 Comments »
Patch-Tag now writes the _darcs/prefs/email file for repositories with the owner’s email. That means if you check out a public repo (without being a member with write access to shared) you can contribute patches back to the repo creator simply with the command darcs send This assumes you have sendmail configured for sending email from [...]
News and improvements
Posted in Uncategorized on October 11, 2009 | Leave a Comment »
Hey everybody. I am once more without day job, and so patch-tag is getting more attention than it is used to. Could patch-tag be a day job, after all? Let’s just say I am toying with this idea but trying to stay grounded too. I don’t have as many users as I wanted when I [...]
Preserving or flattening list structure… an exploration of monad/functor laws
Posted in Uncategorized on October 6, 2009 | 3 Comments »
A wise haskell hacker said you don’t need to understand monads to use em, and this I find to be mostly true. You don’t need to understand category theory either. Lately though, I’ve been trying to deepen my intuition a bit anyway. This is something I wrote lately that I keep revisiting when thinking about [...]