It's actually the challenge #6 from Category Theory for Programmers - Chapter 2, and this question is a follow up on this other question I asked some time ago:
Draw a picture of a category whose only objects are the types
Void,()(unit), andBool; with arrows corresponding to all possible functions between these types. Label the arrows with the names of the functions.
So this is the list of arrows/functions connecting those three objects/types which I'm more sure about:
- 4 functions
Bool -> Bool true = const True :: () -> Boolfalse = const False :: () -> Boolignore = const () :: Bool -> ()absurd :: Void -> ()absurd :: Void -> Boolid :: () -> ()id :: Void -> Voidmust exist because we are talking about a category, right?- there's nothing going to
Voidfrom the other two because it is an initial object, right?
Is this the correct answer?