3 ms·
i really like the syntax, very intuitive use of ->
by efdb 6y ago
i really like the syntax, very intuitive use of ->
- runeks 6y agoI wonder if there’s such a thing as intuitive syntax. As far as I can see, the arrow signifies function application. Why do you consider “a -> f” more intuitive than, say, “f(a)” or “f a”?
- aloisdg 6y agobecause a -> f -> g -> h is better than h(g(f(a))). It is the functional way of doing the OOP fluent builder pattern: a.f().g().h() It is the pipe operator (F#, Elixir, Haxe, etc.). There is a proposal to add it to js too.
- mlajtos 6y agoOn top of that, it is a symmetrical to fat arrow functions, which is a shorthand for lambda: fun: x => x * 2 res: 4 -> fun
- vorticalbox 6y agoI have always used ramdajs for this. const R = require('ramda'); R.pipe(a,f,g,h)
- bijinpanicker 6y agoI added it on python. Check it in https://github.com/LangTrans/Py_Trans https://github.com/LangTrans/Py_Trans