Jul | AUG | Sep
| 20 |
2007 | 2008 | 2009
1 captures 20 Aug 08 - 20 Aug 08 |
| Close Help

# sjs

## geeky ramblings

## Funny how code can be beautiful 0

Posted by sjs
on Monday, April 30

While reading a Haskell tutorial I came across the following code for defining the Fibonacci numbers:

    fib = 1 : 1 : [ a + b | (a, b) <- zip fib (tail fib) ]

After reading it a few times and understanding how it works I couldn’t help but think how beautiful it is. I don’t mean that it’s aesthetically pleasing to me; the beautiful part is the meaning and simplicity. Lazy evaluation is sweet.

Haskell is the most challenging real language I have tried to wrap my head around. I haven’t done much with any functional languages yet but they are truly fascinating. I’m beginning to understand monads1 but I’m quite sure I don’t see the whole picture yet.

Erlang looks like it may be more suited to real world apps so I would like to learn that some time. The pragmatic guys have a book on Erlang in the works, and I love every book of theirs which I have read.

Going deeper down the functional rabbit-hole you’ll find things like this polyglot quine, which absolutely blows my mind. I used to be impressed by the JAPH sigs or some of the various obfuscated contest winners but that first one definitely cleans the rest up with a perfect 10 in geekiness.

[1] The following links have all been helpful while trying to wrap my head around monads.

- A Gentle Introduction to Haskell (link is directly to chapter 9)
- What the hell are Monads?
- Monads on WikiBooks
- Monads for the Working Haskell Programmer

- Tags: haskell
- Meta: 0 comments, permalink

##### Comments

Leave a response

Comment

Name:

Email Address:

Website:

Comment: