Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ask HN: What's your favorite elegant/beautiful algorithm?. Parent comment
I dunno, I really like Haskell's one-line infinite Fibonacci sequence:
> let fibs = 1 : 1 : zipWith (+) fibs (tail fibs) > take 7 fibs [1,1,2,3,5,8,13] > fibs !! 1000 70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501
There are no comments on this comment yet.
I dunno, I really like Haskell's one-line infinite Fibonacci sequence:
I don't think it's the most efficient solution, but it really showcases lazy evaluation with a simple example.