Pithy summary for codata (Where a comonad is a 

2019-07-19 15:27发布

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条回答
男人必须洒脱
2楼-- · 2019-07-19 15:42

"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).

查看更多
登录 后发表回答