Hacker News new | past | comments | ask | show | jobs | submit login

Derivative of a data structure? I never heard of that before, though I'm familiar with derivatives in calculus. How do you calculate the derivative of a data structure? I'm guessing that you start by eliminating values that are constant with respect to some variable, but I'm not sure how you'd reduce the rest. How common is it to have values in a data structure that are non-linearly related to a variable?



You are one the wrong track. You'll be surprised. Look up algebraic data structures and zippers. The partial derivative of an algebraic data structure is its zipper.

See e.g. http://www.haskell.org/haskellwiki/Zipper

And, yes, automatic derivation of zippers is mind blowing, when you encouter it for the first time.





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

Search: