范畴单子在F#语言中的应用研究  

Research on the Application of Monad of Category Theory in Functional Programming F#

在线阅读下载全文

作  者:袁晓月[1] 

机构地区:[1]江西省科学院应用物理研究所,南昌330029

出  处:《江西科学》2014年第4期539-542,共4页Jiangxi Science

摘  要:范畴论中的单子是包含一个函子和2个自然变换的三元组,而函数式F#语言中的单子则是由包含构造子和return操作和bind操作的三元组。针对2种单子定义不一致的问题,首先给出了范畴单子的定义和性质。在此基础上,通过引入(_)*运算符,定义了Kleisli范畴。由此定义了函数语言F#单子。在此基础上给出了F#单子满足的性质与范畴单子性质的对应关系。最后给出了F#单子常见的5种编程情形。A monad of category theory is a triple,which has one functor and two natural transforms, as well as a monad of F# is also a triple, which has one constructor that includes two operator naming return function and bind function. The paper give a mathematical description to cover the gap between the two definitions. The Kleisli category was defined by the operator (_) * after the definition of category theory and its characters. Then the monad of F# and the correspondence of the characters between monad of category and F# was given. Finally, the five scenes of monad of F# were given.

关 键 词:单子 范畴论 fsharp 函数式编程 

分 类 号:TP301.2[自动化与计算机技术—计算机系统结构]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象