Closed technic closed 3 years ago
Hi, Sorry for bothering you. After more thinking a realized that there is no typo. It is funny that there was similar confusion in comments in the Bartosz blog.
Actually I think that challenge (5) makes people somewhat confused about challenge (8). Maybe it can be helpful to add some more hints/comments below.
So in (5) we use the intuitive proof by considering mapping Either -> int
. We find that it is surjective (so in a sense "better") hence there is no way to invert it to obtain morphism int -> c'
(for c'
e.g. Either
) which is required by definition of coproduct. In other words we can not construct it in a way that the factorization
rule is satisfied, because information is lost.
Then in (8) we can consider
data Test a b c = Left a | Right b | Extra c
Then we shall consider morphism Test -> c'
and require it to be unique for all objects c'
. But for c' = Either
there is not unique way to coerce Test
. So here Test
does not follow co-product definition.
https://github.com/hmemcpy/milewski-ctfp-pdf/blob/7de90c718518c3832484dcf24bbbe2c967a2c44c/src/content/1.5/products-and-coproducts.tex#L633-L636
Shall it be "from
Either
to it"?