In 2007, I took a whack at learning Haskell as my Language of the Year. It was an educational experience on more levels than I had expected. I didn’t get as far with the language as I might have hoped, but I did have the essential mind-opening experience of dealing with a purely functional, “lazy” language. My approach and style in my primary day-to-day language (Python) changed in a positive way.
Python has two seemingly similar sequence types, tuples and lists. The difference between the two that people notice right away, besides literal syntax (parentheses vs. square brackets), is that tuples are immutable and lists are mutable. Unfortunately, because this distinction is strictly enforced by the Python runtime, some other more interesting differences in application tend to get overshadowed. One common summary of these more interesting, if subtle, differences is that tuples are heterogeneous and lists are homogeneous.
Today’s notes will be a bit more free-form. Now that the tutorial days are over and the main conference has begun, there are more sessions – and less time to write! Keynotes Tim O’Reilly raised the question of openness beyond source code. This felt a bit amorphous, but he did have a good point that when software is a service, availability of source code is not the whole story – if Google gave you their source, you couldn’t do anything with it.
This is exciting – three notable personalities from the Haskell world (Bryan O’Sullivan, Don Stewart, and John Goerzen) have teamed up to write a new book on Haskell for O’Reilly. Even better, it will be published under a Creative Commons license and released chapter-by-chapter on their website. For now all that’s on their new site is a blog, but that’s sure to change over the coming days and weeks. http://www.realworldhaskell.org/
Preamble This article is two things: A description of one way to use version control with a Django project An introduction to using the darcs distributed version control system in particular First, though, a mini-sermon which someday will be a post in the You Really Should series: You really should use version control. Most of you probably do. But if you’re among those not using version control to manage your software projects, start now!
I came across this neat Python hack on reddit today, a technique for defining arbitrary infix operators. Not overriding + or >> et al., but creating keyword-style pseudo-operators that… well, the code is probably as clear as any description I could come up with: class infix(object): """ Clever hack (slightly modified) for defining infix operators. Via http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122 Intended for use as a decorator. >>> @infix ... def removing(str, chars): ... for char in chars: .