So, we finally come to the actual topic of the event, algebra of programming.
So, we will now deal with functor algebra and we will see that functor algebra gives us an abstraction of the term of the data types that we had at the beginning, back then purely on quantities.
So, we will now simply define what an animal is.
I will start a little longer.
So, the whole thing is always parameterized by a functor on some category.
The category gives us an additional structure on the data. The data can be ordered again, for example, or sometimes a given algebra structure or whatever.
We have seen that there are different examples for possible basic categories.
So, the functor replaces the signature of algebra.
We will see that in detail later.
So, we define what an algebra is for the functor. We will call it an F-algebra.
An F-algebra is a morphism in the basic category, a C-morphism of a certain form.
Given any object A, it is a morphism from F A to A.
So, typically, we will define the structure of the morphism.
So, this morphism here, A, is the structure morphism or the algebra structure.
The structure has a underlying object, which corresponds to the underlying amount of an algebra, as we know it as a monoid, a group or a vector space.
I have briefly delayed the video, as you may have noticed.
Whether I simply say that an F-algebra is a morphism or an F-algebra would be the alternative is a pair.
I sometimes write it like this, but only because I want to get the same name for the type.
Because every morphism has a specific goal, typically.
The morphism amounts between different objects are usually taken as the sum.
So, the information about the beginning and end object is part of the morphism.
It would be enough to say that it is a morphism. Note it!
So, what does this have to do with what we know as algebra?
Let's take the natural numbers for example.
What are the natural numbers as algebra?
As algebra, the natural numbers have a constant and an unnear operation, zero and successor.
You have no laws regarding these operations.
If we take this as a functor, we can apply a summand for each operation.
And we can always multiply so many copies of x in the summand, as the operator's position indicates.
If we do this for a constant and an unnear operation, we have no copies of x that we multiply.
That results in a product of x is 1.
And as a second summand, for the unnear operation, we have a copy of x.
So, if we take fx equals 1 plus x, what is algebra for this thing?
So, we have something like this.
We have a morphism from 1 plus a to a.
I did not say what the underlying category is, and that is completely irrelevant as long as the product is co-ordinate.
And the determinant is so.
So, what is this thing?
I have my injections from 1 and a in here.
In left and in right.
When I compose this, it gives me an operation S, which is called a suggestive.
And up here, by composition, it gives me a morphism called z.
And if I calculate this again, it is a, the copa from these two morphisms, so a is copa z,s.
It is calculated that every morphism from a coproduct breaks up as a copa.
And I get out which morphisms are in the copa by composition with the injections.
Dual, of course, with products.
I have to compose with the projections and then get two morphisms, the original one was the original.
So, effectively, I have such an object here.
I have something that consists of one object of the underlying category, from one morphism of 1 in there and one morphism of the object itself in there.
So, this is an algebra for this function.
Presenters
Zugänglich über
Offener Zugang
Dauer
01:29:02 Min
Aufnahmedatum
2017-07-10
Hochgeladen am
2019-04-02 14:21:02
Sprache
de-DE