All Projects → polossk → Zero-Kara-FCPP

polossk / Zero-Kara-FCPP

Licence: MIT license
Simple Functional Programming of C++ from Scratch 从零开始的简单函数式C++ ZEROから始める使いやすい関数型プログラミング

Programming Languages

C++
36643 projects - #6 most used programming language
assembly
5116 projects
haskell
3896 projects

Projects that are alternatives of or similar to Zero-Kara-FCPP

Fundamental-CPP
The book and code repo for the FREE Fundamental C++ book by Kevin Thomas.
Stars: ✭ 7 (-90.79%)
Mutual labels:  cpp-course
learn stl
Learning how the C++ Standard Library works; by implementation
Stars: ✭ 23 (-69.74%)
Mutual labels:  cpp-course
pacs-examples
The examples for the course on advanced programming for scientific computing (aka PACS), Politecnico di Milano
Stars: ✭ 16 (-78.95%)
Mutual labels:  cpp-course
cpluspluscourse
C++ Course Taught at CERN, from Sebastien Ponce (LHCb)
Stars: ✭ 19 (-75%)
Mutual labels:  cpp-course

从零开始的简单函数式 C++

CC-BY-NC-SA-4.0

如标题所示,这个教程主要是讲解如何用现代的 C++ 以及所配套的 STL 来“函数式”地编程。具体而言,本教程会讲解以下内容:

  • STL 中的主要工具:元组 pairtuple,向量 vector
  • C++11 引入的 lambda 函数
  • 假装在函数式编程的三板斧:filtermapreduce
  • 是否需要引入 lazy 求值
  • 简单的函数操作
  • 递归与状态变换
  • 基础的模板元编程(编译时计算)

当然,如果真的执着于函数式编程的话,C++ 是显然不能满足绝大多数人的要求的,比如不能轻松地进行模式匹配,也没有较为简单地惰性求值。这时候不如推荐一些纯粹的函数式语言例如 Haskell 或者 scheme。

章节说明

其他

  • 本教程的目的在于理解并思考一种可能的 C++ 的函数式编程实现,并非劝诫大家使用函数式 C++
  • 本文同时发布在知乎上,也欢迎大家评论

License

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].