仅包含 Bool Unit 和 Void 的类别中的所有箭头

Enr*_*lis 5 haskell functional-programming purely-functional category-theory

这实际上是程序员类别理论 -第 2 章中的挑战#6 ,这个问题是我前段时间问过的另一个问题的后续问题:

绘制一个类别的图片,其唯一对象是类型Void()(单位)和Bool;箭头对应于这些类型之间所有可能的功能。用函数名称标记箭头。

这是连接这三个对象/类型的箭头/函数列表,我对此更加确定:

  • 4个功能Bool -> Bool
  • true = const True :: () -> Bool
  • false = const False :: () -> Bool
  • ignore = const () :: Bool -> ()
  • absurd :: Void -> ()
  • absurd :: Void -> Bool
  • id :: () -> ()
  • id :: Void -> Void必须存在,因为我们正在谈论一个类别,对吧?
  • Void其他两个不会发生任何事情,因为它是一个初始对象,对吧?

这是正确答案吗?