Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
cygx
on May 18, 2015
|
parent
|
context
|
favorite
| on:
Once you go functional, you can never go back
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, * + * ... *;
cygx
on May 18, 2015
|
next
[–]
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.
dllthomas
on May 19, 2015
|
parent
|
next
[–]
Haskell does this, too.
codygman
on May 19, 2015
|
prev
[–]
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: