|
|
|
|
|
by timruffles
680 days ago
|
|
> nowadays every 16-year-old web-dev reaches for Array.map(x => <div>{x}</div>) when they write their pages in the most popular framework. These higher-order functions have now become part of the “hello world” It's just wrong to ascribe the popularisation of HOFs like `map` to Haskell. `map` was there in good old (practical) Lisp 1.5 back in the 1960s. Why ascribe this to Haskell (released 1990) rather than Lisp? Guido said Python v1 (1994) got HOFs "courtesy of (I believe) a Lisp hacker who missed them"[1], Ruby had blocks in V1 (1995). Haskell's research direction was not about very, very old news like HOFs, it was about non-strict evaluation, and cool type system stuff. [1] https://www.artima.com/weblogs/viewpost.jsp?thread=98196 |
|
That said, to really squeeze the most out of HOFs the language probably needs a well developed type system. I've noticed with untyped code that at some point HOFs start becoming hard to write because the layers of abstraction get confusing in a way that static analysis would be helpful with. Although my lesson there is to not go overboard with HOFs - if I need static analysis to write working code it is probably too clever to understand by reading it! The Haskell community might succeed in proving that view wrong, but until then...