Pithy summary for codata (Where a comonad is a 'type for input impurity')

自作多情 提交于 2019-12-24 05:31:36

问题


In terms of pithy summaries - this description of Comonads seems to win - describing them as a 'type for input impurity'.

What is an equivalent pithy (one-sentence) description for codata?


回答1:


"Codata are types inhabited by values that may be infinite"

This contrasts with "data" which is inhabited only by finite values. For example, if we take the "data" definition of lists, it is inhabited by lists of finite length (as in ML), but if we take the "codata" definition it is inhabited also by infinite length lists (as in Haskell, e.g. x = 1 : x).

Comonads and codata are not necessarily related (although perhaps some might think so due to Kieburtz' paper Comonads and codata in Haskell).



来源:https://stackoverflow.com/questions/17604824/pithy-summary-for-codata-where-a-comonad-is-a-type-for-input-impurity

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