Monads in C++

Monads in C++? What a strange name for a post. But it's not so strange. With std::optional C++17 gets a monad. The ranges library from Eric Niebler and the extended futures are also monads. For both, we can hope for in C++20.

Read more
Tags: C++20
Views: 62278

Concepts

We stay in the year 2020. With high probability, we will get concepts. Of course, waterproof statements about the future are difficult but the statement is from Bjarne Stroustrup (Meeting C++ 2016 at Berlin).

Read more
Views: 20784

The New Ranges Library

A small-time jump and we are in the year 2020. C++ will get - as far as the future is predictable - the new ranges library. Thanks to Eric Nieblers library, working with the Standard Template Library (STL) will become much more comfortable and powerful.

 

Read more
Tags: C++20
Views: 30329

Fold Expressions

With fold expressions, you can implement Haskell known functions foldl, foldr, foldl1 and foldr1 directly in C++. These four functions successively reduce a list to a single value.

Read more
Tags: C++17
Views: 57179

Recursion, List Manipulation, and Lazy Evaluation

The remaining three characteristics of functional programming are told quite quickly: Recursion, manipulation of lists and lazy evaluation.

Read more
Views: 28157

Pure Functions

Pure functions are quite similar to mathematical functions. They are the reason that Haskell is called a pure functional programming language.

Read more
Views: 23098

Immutable Data

A key to purely functional languages is that their data are immutable. Therefore, assignments such as x= x+1 or ++x are not possible in the purely functional language Haskell. The consequence is that Haskell supports no loops like for, while, or until. They are based on the modification of a loop variable. Haskell does not modify existing data; Haskell creates new data when needed and reuses the old ones.

Read more
Tags: constexpr
Views: 19052

Higher-Order Functions

Higher-order functions are the pendant to First-Class Functions because higher-order functions can take functions as an argument or return them as a result.

Read more
Views: 59277

First-Class Functions

One of the characteristics of functional programming is first-class functions. First-class functions behave like data and are heavily used in the Standard Template Library.

Read more
Views: 28292

The Definition of Functional Programming

The definition of functional programming is quite easy. Functional programming is programming with mathematical functions. Is that all? Of course, not!

Read more
Views: 53695

My Newest E-Books

Course: Modern C++ Concurrency in Practice

Course: C++ Standard Library including C++14 & C++17

Course: Embedded Programming with Modern C++

Course: Generic Programming (Templates)

Course: C++ Fundamentals for Professionals

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 4889

Yesterday 7135

Week 36638

Month 47185

All 6275657

Currently are 156 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments