concept corecursion in category idris

appears as: corecursion
Type-Driven Development with Idris

This is an excerpt from Manning's book Type-Driven Development with Idris.

Terminology: recursion and corecursion, data and codata

You may hear Idris programmers referring to functions such as countFrom as corecursive rather than recursive, and infinite lists as codata rather than data. The distinction between data and codata is that data is finite and is intended to be consumed, whereas codata is potentially infinite and is intended to be produced. Whereas recursion operates by taking data and breaking it down toward a base case, corecursion operates by starting at a base case and building up codata.