Replies: 3 comments 1 reply
-
Assuming that for a function F between types, and any function f between values, one can define an then Let's show one direction: composition laws implies functor laws.
In fact, this is not really a closure property? That looks more like an absorption property.
Applying this with
|
Beta Was this translation helpful? Give feedback.
-
What I can't show is that if we assume a composition operation |
Beta Was this translation helpful? Give feedback.
-
A category is defined by:
The composition operation that can be used is always and only the one defined by the category being used, that is Now, if I have a map between objects So we either give up or look for a concept of "composition" (I use quotation marks here to indicate that it is not the composition of the category but a custom composition concept that simply has a utilitarian purpose) that is "good" for our purposes. To do this, we must somehow transform the involved morphisms because, as we have already said, there is no way to compose them using However, there are many transformations that we can apply, for example to We could try to transform
but which of these transformations is "good"? Each of them can be composed via The concept of functor is therefore a guide to make a choice, and it tells us that a good choice is |
Beta Was this translation helpful? Give feedback.
-
Hi,
Here it is mentioned that functors, applicative functors, and monadic functors enables composition with a specific class of functions.
I could recover the equivalence between the monadic laws and the properties that must fulfill a composition operation (associativity, identity, closeness under operation, etc.) but I am stuck when I try to do the same for functors.
In the case of monads, we are dealing with functions$f: A -> M\ B$ , for any morphism $M$ (that's the right name right?). So when looking for a composition operation, we are composing two functions of the same shape, we know the resulting shape.
However, the example with functors involves composing functions of different shapes.$f: A -> F\ B$ , and $g: B -> C$ . I am stuck as I can't even deduce what is the domain and codomain of $g \circ f$ from the properties of the composition operation.
Should I posit that$g \circ f$ is of the shape $A -> F\ Y$ and work from there? or can I deduce somehow for instance that the codomain of $g \circ f$ must be $F\ Y$ for some suitable $Y$ ?
Beta Was this translation helpful? Give feedback.
All reactions