CppCon 2015: Michał Dominiak “Functional programming: functors and monads'

preview_player
Показать описание


Following the 'Applying functional programming in code design' session from Wednesday, I'd like to conduct a 'crash course' on functors and monads, and why they are important - and useful - regardless of the language you are writing code in.

Computer Science student at Faculty of Electronics at Wrocław University of Technology. Loves metaprogramming and doing as much as possible during compile time, instead of wasting precious cycles at runtime.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

Slide #16 There's nothing wrong about >>= in C++. It is right-to-left associative and that's what it does. I used >> for monadic bind operations in LEESA (Language for Embedded Query and Traversal). Operator >>= is used in depth-first traversal.

sutambe
Автор

@Sumant: that is precisely what is wrong with it. `a >>= b >>= c` should mean `(a >>= b) >>= c` when used as monadic bind, but in C++ it means `a >>= (b >>= c)`.

michadominiak