首页> 外文期刊>Science of Computer Programming >Implementing monads for C++ template metaprograms
【24h】

Implementing monads for C++ template metaprograms

机译:为C ++模板元程序实现monad

获取原文
获取原文并翻译 | 示例

摘要

C++ template metaprogramming is used in various application areas, such as expression templates, static interface checking, active libraries, etc. Its recognized similarities to pure functional programming languages - like Haskell - make the adoption of advanced functional techniques possible. Such a technique is using monads, programming structures representing computations. Using them actions implementing domain logic can be chained together and decorated with custom code. C++ template metaprogramming could benefit from adopting monads in situations like advanced error propagation and parser construction. In this paper we present an approach for implementing monads in C++ template metaprograms. Based on this approach we have built a monadic framework for C++ template metaprogramming. As real world examples we present a generic error propagation solution for C++ template metaprograms and a technique for building compile-time parser generators. All solutions presented in this paper are implemented and available as an open source library.
机译:C ++模板元编程用于各种应用领域,例如表达式模板,静态接口检查,活动库等。它与纯函数式编程语言(如Haskell)的公认相似之处使采用高级函数技术成为可能。这种技术使用的是monads,它们是表示计算的编程结构。使用它们,可以将实现域逻辑的操作链接在一起,并用自定义代码进行修饰。在高级错误传播和解析器构造等情况下采用monad可以使C ++模板元编程受益。在本文中,我们提出了一种在C ++模板元程序中实现monad的方法。基于这种方法,我们为C ++模板元编程建立了Monadic框架。作为实际示例,我们提供了一种用于C ++模板元程序的通用错误传播解决方案以及一种用于构建编译时解析器生成器的技术。本文介绍的所有解决方案均已实现并可以作为开源库使用。

著录项

  • 来源
    《Science of Computer Programming》 |2013年第9期|1600-1621|共22页
  • 作者单位

    Department of Programming Languages and Compilers, Faculty of Informatics, Eoetvoes Lorand University, Pazmany Peter setany 1/CH-1117 Budapest, Hungary;

    Department of Programming Languages and Compilers, Faculty of Informatics, Eoetvoes Lorand University, Pazmany Peter setany 1/CH-1117 Budapest, Hungary;

  • 收录信息 美国《科学引文索引》(SCI);美国《工程索引》(EI);
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

    C++ template metaprogram; Monad; Exception handling; Monoid; Typeclass;

    机译:C ++模板元程序;单子;异常处理;Monoid;类型类;

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号