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

I wish Typescript had support for partial function application, since I use that much more than “Executioner” classes.

Actually, I’ve moved away from OOP in general in my JavaScript, only as a last resort. (Not going to put in long comment from tablet screen...)




Outside of type annotations, Typescript never supports syntax that isn't in an ECMAScript standard or a popular proposal.

That said, there is a Stage 1 TC39 proposal for partial application. https://github.com/tc39/proposal-partial-application


Thanks for the tip.

I have been using Ramda’s R.partial() function a bit, as well as some in-house stuff (e.g. - to generate 0-arity event handlers), but this would be a very helpful feature, particularly once IDE recognition becomes widespread.

Background: suite of related projects started in early 2015, ES5 on IE11 kind of limitations... (recently started using a transpiler for syntactic sugar)


Partial function application would be sweet. I wind up manually currying a lot of functions and readability starts to get sketchy.

  const foo = (a: number, b: number): number => { /*...*/ }
to

  const foo = (a: number) => (b: number): number => { /*...*/ }




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: