What is the analog of Category in programming

 ̄綄美尐妖づ 提交于 2019-12-04 02:16:12

问题


I found that there is an isomorphism between logic and programming, called Curry-Howard correspondence, so is there any such equivalence for Category theory, which helps to understand things like Functors or Monads?


回答1:


Yes! It's called Curry–Howard–Lambek - it maps Category objects to types and morphisms to terms. So, typed lambda (function without name) or even function may be represented as cartesian-closed category, where Unite-type becomes a terminal object, set of types (or more complex structure) is product, and apply+currying is exponential.



来源:https://stackoverflow.com/questions/27752424/what-is-the-analog-of-category-in-programming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!