« withdrawal: day 2 | Home | LISPing Avery Brooks »

March 4, 2008

my mind was just blown

i'm half-way through understanding this bit of haskell:

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

if i correctly understand "lazy evaluation", then i understand how this can work without infinite memory space.

neat!

1 Comment

i did indeed understand it correctly, and i also understood the implication, which the tutorial then went on to state:

It is often easier to code the general definition for something than to write a function that generates a specific value.

now that's a paradigm shift!

Leave a comment

About this Entry

This page contains a single entry by sainttoad published on March 4, 2008 3:34 PM.

withdrawal: day 2 was the previous entry in this blog.

LISPing Avery Brooks is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.