Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sometimes I want partial application and other functional paradigms... to reduce LOC by 90%


I’m currently in the process of picking up elixir. When you say partial application, are you referring to the use of the capture operator `&`?


Bad explanation from a noob (me), but basically yes. Functions just always fit together and I don't need ugly sprawling interfaces or pointless declarations of nearly identical functions.

In Elixir when I want to pass a function with 3 arguments into an interface that expects 4, I can do something inline with no extra boilerplate like func(&1, &2, &3, <a default 4th value to be used in each invocation>)


Not your parent commenter but likely they at least partially meant that, yes.

Though that alone can't reduce LoC by 90%. Elixir is just incredibly terse and no-bullshit language in general. All the shorter code idioms together make for a readable and to-the-point code.




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

Search: