Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tromp
on Oct 17, 2018
|
parent
|
context
|
favorite
| on:
Ask HN: What's your favorite elegant/beautiful alg...
Or the even more succinct
fibs = 0 : scanl (+) 1 fibs
scanl is similar to a fold, but returns a list of successive reduced values from the left.
squirrelicus
on Oct 17, 2018
[–]
That's fantastic!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: