Abstract
Modern functional programming languages, such as Haskell, Scala, ML, and F#, have properties that make it possible to implement logically complicated algorithms relatively easily. Among such properties is the composition of functions, currying, metafunctions (functions over functions), and some others. This makes it possible to obtain complex functions by combining simpler functions. An example of a complicated algorithm is a parser. In Haskell, there is a library called Parsec, which is a set of elementary parsers; by combining these parsers, one can create more complicated parsers. This fact makes the library relatively simple, yet powerful. The majority of these tools are not explicitly included in C++. However, C++ is sufficiently powerful for implementing many properties of functional programming languages. In this paper, an attempt is made to develop such a library.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.REFERENCES
Haskell language. https://www.haskell.org/
The Scala Programming Language. https://www.scala-lang.org/
Standard ML of New Jersey. http://smlnj.org/
Visual F#. https://msdn.microsoft.com/ru-ru/visualfsharpdocs/conceptual/visual-fsharp
FC++: Functional Programming in C++. https://yanniss.github.io/fc++
C++ template library for fans of functional programming. https://github.com/beark/ftl
Abrahams, D. and Gurtovoy, A., C++ Template Metaprogramming, Addison-Wesley, 2004.
Krasnov, M.M., Metaprogramming of C++ Templates in Problems of Mathematical Physics, Moscow: Keldysh Institute Prikladnoi Matematiki, 2017. DOI: http://keldysh.ru/e-biblio/krasnov https://doi.org/10.20948/mono-2017-krasnov
Krasnov, M.M. and Ladonkina, M.E., Discontinuous Galerkin method on three-dimensional tetrahedral grids. The use of template metaprogramming of the C++ language, Program. Comut. Software, 2017, no. 3, pp. 172–183. https://elibrary.ru/download/elibrary_29207399_42944924.pdf
Boost C++ Libraries. https://www.boost.org/
Parsec: Monadic parser combinators. http://hackage.haskell.org/package/parsec
Krasnov, M.M., Operator library for solving 3Dl mathematical physics problems on CUDA, Mat. Model., 2015, vol. 27, no. 3, pp. 109–120. http://www.mathnet.ru/ links/38633e7a627ab2ce1527ae4a092be72f/mm3585.pdf
Krasnov, M.M., Grid-Operator approach to programming mathematical physics problems, Cand. Sci. (Phys.-Math.), Moskow: Keldysh Inst. of Applied Mathematics, Russian Academy of Sciences, 2017. http://keldysh.ru/council/1/2017-krasnov/avtoref.pdf
Author information
Authors and Affiliations
Corresponding author
Additional information
Translated by A. Klimontovich
Rights and permissions
About this article
Cite this article
Krasnov, M.M. Functional Programming Library for C++. Program Comput Soft 46, 330–340 (2020). https://doi.org/10.1134/S0361768820050047
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S0361768820050047