引用本文:吕江花,金成植.Monad的一种自动生成技术.软件学报,2003,14(12):1989-1995
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 4378次   下载 6313 本文二维码信息
码上扫一扫!
分享到: 微信 更多
Monad的一种自动生成技术
吕江花1, 金成植1
吉林大学,计算机科学与技术学院,吉林,长春,130012
摘要:
Monad程序的核心是一组Monad定义.Monad定义分为MAP型和BIND型.如果在Monad库中已有所需要的Monad定义型,则可以直接使用,而不需要重新构造;否则,需要重新构造.但如果在Monad程序设计环境中增加从一类Monad构造另一类Monad的自动生成器,那么既方便了用户也扩充了1倍原有的Monad库.鉴于这种思想,用支持Monad程序设计的高阶函数语言Haskell实现了一个Monad的自动生成系统.另外,用户构造Monad不仅要花费较多的时间,而且写出的Monad多态函数往往不满足Monad所需满足的几条公理,因此,从这方面也可以看出,从一种类型的Monad自动产生另一种类型的Monad的重要意义.
关键词:  Monad  BIND型Monad  MAP型Monad  范畴  高阶函数
DOI:
分类号:
基金项目:Supported by the National Natural Science Foundation of China under Grant No.60073041 (国家自然科学基金)
An Automatic Generation Technique for Monad
Lü Jiang-Hua,JIN Cheng-Zhi
Abstract:
The main focus in Monad-oriented programming is on a set of Monad definitions and a Monad can be defined in an MAP style or a BIND style. Given a Monad library, it can be used directly if it meets the style of the users?need, otherwise, a new style of Monad should be reconstructed, which is a fussy job and even more the new one may not always satisfy the axioms of a Monad definition. However if an automatic Monad generator is added to the library, users can use a Monad freely without asking whether a new style of Monad is needed or how to construct a Monad in order to satisfy the several axioms of the Monad definition, which not only benefits users but also extends the original Monad library. In this paper an automatic Monad generator from other style of Monad is designed and implemented in Haskell. The generating arithmetic is based on the identity relationship between two Monad definitions.
Key words:  Monad  BIND Monad  MAP Monad  category  high-order function

引用本文:
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览次   下载  
分享到: 微信 更多
摘要:
关键词:  
DOI:
分类号:
基金项目:
Abstract:
Key words: