際際滷

際際滷Share a Scribd company logo
Python朱 FP蠍
Functional programming
Wonho Ha aka Las

襦蠏碁襾
AI 蟯 襷.
Content
Hello Functional World
Python fallin into FP
 FP 貊
 譬 貊襯 ロ伎
Hello Functional World!
Introduction
Wonho Ha aka Las
れ願斡帝
Functional Programming
れ願斡帝
Functional
れ願斡帝
Programming
FP レ
皙ル襭
皙ロ
皙ロろ語
皙ル豌襴
皙レ覩!
FP
functional programming is a programming paradigm that treats
computation as the evaluation of mathematical functions and avoids
changing-state and mutable data.
FP
Functional Programming
FP 旧
FP 旧
矧
FP 旧
螻燕蟲  蠍一旧
企る慨
矧
FP 旧
X螳 螳朱
Y 螳
FP 旧
input 螳朱
output 螳
FP 旧
Pure Function
(矧)
pure function is a function that has the following properties:
Its return value depends only on its parameters and not on any internal or external state
(such as local static variables, non-local variables or inputs from I/O devices).
Its evaluation has no side effect (such as mutation of local static variables or non-local
variables, or performing I/O operations).
Pure function
Pure function
蠏碁 磯Μ 矧螳
蟾?
Pure function
Pure function
Whats matter
Side Effect
Pure function
Side Effect
觜蟲企慨!
OOP vs FP
function
Method != Function
れ願斡帝
FP襯 蟆 螻蠍
企 譴 FP蠍磯
皙Java8 Lambda, Stream
皙Map/Reduce
皙C++ tail recursion optimization
皙JavaScript anonymous function
蟆  螻蠍
襷 矧 語企
皙Rust
皙Lisp(Clojure)
皙Elixir
皙Haskell
皙Scala
蟆  螻蠍
れ願斡帝
蟆  螻蠍
一る所 蟯 螳蟆
蟆  螻蠍
Python FP襯 企慨!
蟆  螻蠍
( 蟇一 糾豌 伎)
Python fallin into FP
Pythons FP function
Wonho Ha aka Las
FP 蠍
Python multi-paradigm語!
Python 矧 蠍磯
皙Map/Reduce
皙High order function
皙Lambda
皙Generator
皙Iterator
Python 蠍磯ル
Python 蠍磯ル
Higher Order Function
Higher Order Function
Higher Order Function
Higher Order Function
Higher Order Function
Python 蠍磯ル
蟲 覩碁
Higher Order Function
Closure
Higher Order Function
矧螳 ロ 一危
Higher Order Function
Higher Order Function
Python FP襯   覓語
皙tail optimization
皙Lambda 覿ク
皙immutable
皙Curring
覿 覓語
Python FP襯   覓語
皙tail optimization
皙Lambda 覿ク
皙immutable
皙Curring
覿 覓語
覿 覓語
豕螳 伎讌 !
覿 覓語
覿 覓語
python is not
pure functional
覿 覓語
願屋豈?
蟲語!
Decorator
(syntactic sugar)
 FP 貊
Math + Lib
Wonho Ha aka Las
FP 蠍
讌 蠍磯 < FP 貊
Functional蟆 覓語襯 願屋 
皙ル語襯 讓手
皙レ手讌 覓語襯 襷 讓手
皙ロ 覓語襯 願屋 矧襯 襷
皙レ矧襯 蟆壱
FP 蠏朱
FP 蠏朱
OOP vs FP
FP 蠏朱
覓語襯 讓手螻 覈 .
Math
FP  蠍磯 螻
Math
Category theory
Math
覈螳讌 螻給   襭
Math
企 螻 れ襦 矧企骸蟾?
 襷り鍵 覿螳ロ蠍一
FP襯 譯朱 殊企襴!
Python FP襯 譯朱 Lib
皙Pymonad
皙fn.py
殊企襴
 譬 貊襯 ロ伎
願  讌 襷蟇瑚?
Wonho Ha aka Las
for覓語  蟾?
For loop is functional
Python Code
Pythonic Code
FP るジ 覓語
皙レ
皙cant functional
皙lots learning
 譟伎 覓語
One
Slow
One
Lazy Evaluation
One
Memoization
Two
Cant Pure functional
Two
IO monad doesnt make a function pure;
it just makes it obvious its impure
Three
Learning Time
蠏碁 蟆郁記
蠏碁 蟆郁記
Q/A

More Related Content

Aassss