• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2006, Vol. 28 ›› Issue (7): 119-122.

• 论文 • 上一篇    下一篇

一种基于组合Monad的纯函数式Lazy I/O操作

袁华强[1] 王亚强[2] 孙永强[3]   

  • 出版日期:2006-07-01 发布日期:2010-05-20

  • Online:2006-07-01 Published:2010-05-20

摘要:

Monad作为构造纯函数式语言的工具,能构造出诸如错误处理、状态、I/O等非纯函数式语言的特征.本文通过组合状态转换Monad和异常处理Monad来定义纯函数式LazyI/O操作,既保持了纯函数式语言的特征,又融入了非纯函数式语言的特征.

关键词: 纯函数式语言 Monad lazy I/O

Abstract:

Monads serve as the basis for adding other features to a pure functional language, such as exception, state and I/O. This paper defines the pure funct  ional lazy I/O operations based on Monads by combining a state transformer monad with an exception processing monad. This method shows that I/O can be i  ncorporated into pure functional languages without losing the advantages of pure functional languages

Key words: pure function language, Monad lazy I/O