Very good presentation of Functional C++ by the guru Kevlin Henney.

Piping (Functional Composition) in Channels Asynchronously Concurrency:

h

…

Very good presentation of Functional C++ by the guru Kevlin Henney.

Piping (Functional Composition) in Channels Asynchronously Concurrency:

h

…

Advertisements

https://dev.to/codemouse92/dead-simple-python-lambdas-decorators-and-other-magic-5gbf

Python is multi-paradigm: OO or FP.

Useful Functional Programming Techniques :

**Closure**: local variables**Resursion**: stop unlimiting looping**Lambdas**: anonymous function for 1-time throw-away functions- Nested Function: function returns a function as result.
**Decorators**: wrap an existing function with additional features without modifying it.

https://dev.to/jvanbruegge/what-the-heck-is-polymorphism-nmh

Examples: Generics

What is an algebra? by Tikhon Jelvis https://www.quora.com/What-is-an-algebra/answer/Tikhon-Jelvis?ch=3&share=2dd8711d&srid=oZzP

“Basically, an algebra is just an algebraic structure. It’s some set A along with some number of functions closed over the set. It’s a generalization over the structures we normally study: a group is an algebra, a ring is an algebra, a lattice is an algebra… etc.

Algebras have different “signatures” which specify the functions it has. For example, a group is an algebra that has an identity element, a function of one argument and a function of two arguments.

That is, a group with a carrier set A is just a tuple:

⟨A, 0:A, −:A→A, +:A×A→A⟩

For uniformity, we can write all of these as functions in the form An→A, where n is the “arity” of a function—the number of arguments it has. The identity element is a function A0→A, which just identifies a single element from A. Thus, we can talk about the signature of an algebra as the arities of its functions.

A group would be (0, 1, 2) while a ring would be (0, 0, 1, 2, 2).

Generally, the functions of an algebra have to be associative. Sometimes, we also look at other laws—for example, we might want to study algebras with commutative operations like Abelian groups.

So the intuition for an algebra in general is that it’s any structure like a group, a ring or whatever else we like. As the name “structure” implies, these additional operations on a set expose the internal structure of its elements:

a group describes symmetries, a lattice describes a partial order and so on.

The study of algebras, then, can be thought of as the study of “structured sets” in general.”