函数式编程的终极形式:面向映射流的编程pipeline

1、单体(数据)映射:基本操作;数据的单次映射;

2、管道流:数据的流程化处理

基础是monand类型,形式是声明式编程;

Pipeline模型:

它以一种“链式模型”来串接不同的程序或者不同的组件,让它们组成一条直线的工作流。这样给定一个完整的输入,经过各个组件的先后协同处理,得到唯一的终于输出。

pipeline(管道)借鉴于 Unix Shell 的管道操作——把若干个命令串起来,前面命令的输出成为后面命令的输入,

面向(monad)类型的编程:类型是流上的节点;

类型的上下转换、类型对pipeline的串联;

linq lino dsl sql pipeline

链式编程与pipeline;

链式编程:一个操作的输出是下一个操作的输入;

函数式编程与linq;

数据的条件查询处理;

lino:

数据的流式操作;

函数式编程与声明式编程;

函数式编程的操作符描述逻辑,具体的操作交由底层的命令式编程来处理。

函数式编程与命令式编程的关系;

semicolon is the operator used to chain together individual statements in many imperative programming languages,

函数式编程的操作符描述逻辑,具体的操作交由底层的命令式编程来处理。

programmable semicolons:连接键

生产线集成、集成生产线、函数单元间的传送带;

Monads allow a programming style where programs are written by putting together highly composable parts, combining in flexible ways the possible actions that can work on a particular type of data. As such, monads have been described as "programmable semicolons"; a semicolon is the operator used to chain together individual statements in many imperative programming languages,[2] thus the expression implies that extra code will be executed between the actions in the pipeline. Monads have also been explained with a physical metaphor as assembly lines, where a conveyor belt transports data between functional units that transform it one step at a time.[3]

上一篇:CF1244C The Football Season 题解


下一篇:58.第五章 文本处理工具和正则表达式 -- 文本处理三剑客之 awk (一)