首页 | 本学科首页   官方微博 | 高级检索  
     检索      

泛型程序的多型值构造
引用本文:丁志义,宋国新,邵志清.泛型程序的多型值构造[J].华东理工大学学报(自然科学版),2006,32(8):967-969,1006.
作者姓名:丁志义  宋国新  邵志清
作者单位:华东理工大学计算机科学与工程系,上海,200237;宁夏大学数学与计算机学院,银川,750021;华东理工大学计算机科学与工程系,上海,200237
摘    要:泛型程序设计提供了一种重要的程序设计范型,使程序员无须为不同的数据类型重复编写功能相似的程序代码。本文以相等函数为例阐述了泛型程序设计的基本方法,并利用直积和直和给出了构造多型值的方法。利用这一结果能够定义各种数据类型的相等性,同时,定义相等性的方法也可以自然地推广到其他函数的定义上。

关 键 词:泛型程序设计  类型  函数式语言
文章编号:1006-3080(2006)08-0967-03
收稿时间:2005-05-18
修稿时间:2005年5月18日

Constructing Polytypic Values in Generic Programs
DING Zhi-yi,SONG Guo-xin,SHAO Zhi-qing.Constructing Polytypic Values in Generic Programs[J].Journal of East China University of Science and Technology,2006,32(8):967-969,1006.
Authors:DING Zhi-yi  SONG Guo-xin  SHAO Zhi-qing
Abstract:As an important programming paradigm,generic programming relieves the programmer from repeatedly writing codes of similar functionality for different data types.In functional programming,equality function is a very common operator for comparing two values of the same data type,we use this concrete example to explain the basic method of constrcuting generic programs and polytypic values.The methods are capable of defining equality on every data type.Moreover,this way of defining equality can be generalized naturally to a large number of other functions.
Keywords:generic programming  type  functional programming language  
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号