【24h】

Lightweight Higher-Kinded Polymorphism

机译:轻量级的高级多态性

获取原文

摘要

Higher-kinded polymorphism -i.e. abstraction over type constructors- is an essential component of many functional programming techniques such as monads, folds, and embedded DSLs. ML-family languages typically support a form of abstraction over type constructors using functors, but the separation between the core language and the module language leads to awkwardness as functors proliferate. We show how to express higher-kinded polymorphism in OCaml without functors, using an abstract type app to represent type application, and opaque brands to denote abstractable type constructors. We demonstrate the flexibility of our approach by using it to translate a variety of standard higher-kinded programs into functor-free OCaml code.
机译:更高种类的多态性-即类型构造函数上的抽象-是许多功能编程技术(例如monad,folds和嵌入式DSL)的重要组成部分。 ML系列语言通常在使用函子的类型构造函数上支持一种抽象形式,但是随着函子激增,核心语言和模块语言之间的分离导致尴尬。我们展示了如何使用抽象类型应用程序来表示类型应用程序,以及使用不透明品牌来表示可抽象类型构造函数,而不使用函子来在OCaml中表达更高种类的多态性。通过使用它将各种标准的,种类繁多的程序转换为无函子的OCaml代码,我们展示了我们方法的灵活性。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号