Skip to main content
Log in

Functional Programming Library for C++

  • Published:
Programming and Computer Software Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

REFERENCES

  1. Haskell language. https://www.haskell.org/

  2. The Scala Programming Language. https://www.scala-lang.org/

  3. Standard ML of New Jersey. http://smlnj.org/

  4. Visual F#. https://msdn.microsoft.com/ru-ru/visualfsharpdocs/conceptual/visual-fsharp

  5. FC++: Functional Programming in C++. https://yanniss.github.io/fc++

  6. C++ template library for fans of functional programming. https://github.com/beark/ftl

  7. Abrahams, D. and Gurtovoy, A., C++ Template Metaprogramming, Addison-Wesley, 2004.

    Google Scholar 

  8. 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

    Book  Google Scholar 

  9. 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

  10. Boost C++ Libraries. https://www.boost.org/

  11. Parsec: Monadic parser combinators. http://hackage.haskell.org/package/parsec

  12. 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

  13. 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

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to M. M. Krasnov.

Additional information

Translated by A. Klimontovich

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Krasnov, M.M. Functional Programming Library for C++. Program Comput Soft 46, 330–340 (2020). https://doi.org/10.1134/S0361768820050047

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1134/S0361768820050047

Navigation