All arrows in a category only containing Bool Unit and Void

Viewed 188

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), and Bool; 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 :: () -> Bool
  • false = const False :: () -> Bool
  • ignore = const () :: Bool -> ()
  • absurd :: Void -> ()
  • absurd :: Void -> Bool
  • id :: () -> ()
  • id :: Void -> Void must exist because we are talking about a category, right?
  • there's nothing going to Void from the other two because it is an initial object, right?

Is this the correct answer?

0 Answers
Related