Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Functional Programming
2016/3
C++
y = cos x/3
Functional?
Differences from
Imperative
in C++
Agenda
Functional?
declarative code
higher-order function
static binding
lazy evaluation
Functional Programming is
C/C++ (Imperative)
Declarative code
std::function(), ,
, callback ,
DI, etc.
Higher-order function
Static binding
(eager evaluation)
C/C++
Lazy evaluation
PROS!
IO
CONS"
That is…
C/C++
Imperative vs. Functional
C++ Haskell
Imperative vs. Functional
https://msdn.microsoft.com/ja-jp/library/bb669144.aspx
Programming Paradigms


http://docs.python.jp/3/howto/functional.html
Imperative vs. Functional
Imperative & Functional
C++
Haskell
💎
💎
💎
💎 💎
💎
💎
Training in FP, with C++
Immutable
const / const&
const
const (mutating
)
Immutable
FP
UI In/Out
FP
Immutable
lambda 

API
vector<int> function_name([xxx,] vector<int> &array);
result = filter_prime(sort(take3(array)));
vector<int> function_...
OK
Program is …
disposable
code
long life
code
immutable
immutable
mutable
Recap
C/C++
Recap
Try! FP
functional programming & c++
functional programming & c++
functional programming & c++
functional programming & c++
functional programming & c++
functional programming & c++
functional programming & c++
functional programming & c++
Upcoming SlideShare
Loading in …5
×

functional programming & c++

419 views

Published on

関数型プログラミングについて2016/3時点での私の知識をまとめ、C++にどうやって適応していくと皆幸せになれるかを説明しました。
間違っているところなど、コメントお待ちしています。

Published in: Software
  • Be the first to comment

functional programming & c++

  1. 1. Functional Programming 2016/3 C++ y = cos x/3
  2. 2. Functional? Differences from Imperative in C++ Agenda
  3. 3. Functional?
  4. 4. declarative code higher-order function static binding lazy evaluation Functional Programming is
  5. 5. C/C++ (Imperative) Declarative code
  6. 6. std::function(), , , callback , DI, etc. Higher-order function
  7. 7. Static binding
  8. 8. (eager evaluation) C/C++ Lazy evaluation
  9. 9. PROS!
  10. 10. IO CONS"
  11. 11. That is…
  12. 12. C/C++
  13. 13. Imperative vs. Functional C++ Haskell
  14. 14. Imperative vs. Functional https://msdn.microsoft.com/ja-jp/library/bb669144.aspx
  15. 15. Programming Paradigms 
 http://docs.python.jp/3/howto/functional.html
  16. 16. Imperative vs. Functional
  17. 17. Imperative & Functional C++ Haskell
  18. 18. 💎 💎 💎 💎 💎 💎 💎
  19. 19. Training in FP, with C++
  20. 20. Immutable
  21. 21. const / const& const const (mutating ) Immutable
  22. 22. FP UI In/Out FP Immutable
  23. 23. lambda 

  24. 24. API vector<int> function_name([xxx,] vector<int> &array); result = filter_prime(sort(take3(array))); vector<int> function_name([xxx,] vector<int> &array); result = take3(filter_prime(sort(array)));
  25. 25. OK Program is … disposable code long life code
  26. 26. immutable
  27. 27. immutable mutable
  28. 28. Recap
  29. 29. C/C++ Recap
  30. 30. Try! FP

×