forked from ethan-funny/explore-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.md
More file actions
22 lines (15 loc) · 1.32 KB
/
Copy pathREADME.md
File metadata and controls
22 lines (15 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 函数式编程
**函数式编程(functional programming)**是一种[编程范式(Programming paradigm)](https://zh.wikipedia.org/wiki/%E7%BC%96%E7%A8%8B%E8%8C%83%E5%9E%8B),或者说编程模式,比如我们常见的过程式编程是一种编程范式,面向对象编程又是另一种编程范式。
函数式编程的一大特性就是:可以把函数当成变量来使用,比如将函数赋值给其他变量、把函数作为参数传递给其他函数、函数的返回值也可以是一个函数等等。
Python 不是纯函数式编程语言,但它对函数式编程提供了一些支持。本章主要介绍 Python 中的函数式编程,主要包括以下几个方面:
* [高阶函数](./high_order_func.md)
* [匿名函数](./anonymous_func.md)
* [map/reduce/filter](./map_reduce_filter.md)
* [闭包](./closure.md)
* [装饰器](./decorator.md)
* [partial 函数](./partial.md)
# 参考资料
- [什么是函数式编程思维? - 知乎](https://www.zhihu.com/question/28292740)
- [编程范型 - 维基百科,自由的百科全书](https://zh.wikipedia.org/wiki/%E7%BC%96%E7%A8%8B%E8%8C%83%E5%9E%8B)
- [函数式编程初探 - 阮一峰的网络日志](http://www.ruanyifeng.com/blog/2012/04/functional_programming.html)
- [函数式编程 | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/10822.html)