Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Functional programming C++ template library (github.com/beark)
44 points by frostmatthew on Dec 6, 2013 | hide | past | favorite | 12 comments


This is awesome. Maybe the successor to C++ will be C++. Another really neat library is libcppa[1], which provides erlang-inspired concurrency with the actor model but also support for general functional features like pattern matching and guards.

[1]http://neverlord.github.io/libcppa/manual/index.html


>Maybe the successor to C++ will be C++

True that. I really like where C++ is going. C++ is getting almost as expressive as ML.

Thanks for linking the libcppa library. As a fan of Erlang and a former C++ day-jobber, I find this fascinating.


> Maybe the successor to C++ will be C++

Maybe ISO could do a Python 3 and remove the C cruft someday.


As less haskellish approach to functional programming boost library: http://www.boost.org/doc/libs/1_55_0/libs/range/doc/html/ind... is nice. It allows me to write:

  v | filtered( [] (int i) { return i % 2 == 0;}) | transformed([] (int i) { return i * 2;})
instead of:

  vector<int> filtered;
  copy_if(begin(v), end(v), back_inserter(filtered), [](int x) { return x % 2 == 0;});
  vector<int> transformed;
  transform(begin(filtered), end(filtered),    back_inserter(transformed), [](int x) { return x * 2;});


I find this a surprisingly good explanation of the benefits of functional programming, not just a how-to guide for the library. It probably helps that I've read LYAH first however...


Does this solve the problem of operator>>= being right-associative, while Haskell's (>>=) is left-associative?


Wow, that is beautiful! Thanks.


Choking linker with lengthy symbols.... coffee time!


What happened to all of the excitement about functional programming?


My excitement lasted several years. I think it was enough :)


Sounds like you are now back to imperative/OOP. If that is so, why?


Because of my excitement I almost jumped into academia, for PL research. Then, I realized that I have a family to feed :) and after all, I never really wanted to become a teacher/professor.

As for the "real world" side - I'm in the domain where C++ is still the best tool - good enough high-level constructs (but could be better, of course, we're slowly moving toward it) along with low-level stuff and determinism.




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

Search: