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

I'm really into partial application when you wish to mock some data for testing, and the caller chain of that test is shallow. That is:

* function under test takes in a data as its last parameter

* partially applied version of this function is used in a test

* testing function constructs fake data

* testing function calls the partially applied version

It's also nice for code reuse in libraries, but I'm generally less inclined to use it unless I know that the thing I'm working on has dead-simple requirements and won't change much.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: