Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Haskell code in question:

    fibs = 1:1:zipWith (+) fibs (tail fibs)
It's also a common showcase for Perl6 lazy lists:

    my @fibs = 1, 1, * + * ... *;


Note that Perl6 uses big integers by default, so this will work even beyond the limit n=92 at which 64-bit integers will overflow.


Haskell does this, too.


I will admit perl 6 is pretty damn cool. I'll definitely have to look at it soon.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: