Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

polossk/Zero-Kara-FCPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, visithttp://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp