Title of article :
Implementing monads for C++ template metaprograms
Author/Authors :
?bel Sinkovics، نويسنده , , Zolt?n Porkol?b، نويسنده ,
Issue Information :
ماهنامه با شماره پیاپی سال 2013
Abstract :
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.
Keywords :
Monad , Exception handling , Monoid , Typeclass , C++ template metaprogram
Journal title :
Science of Computer Programming
Journal title :
Science of Computer Programming