4 ms·
Speaking of things that the Haskell type system lets you make explicit, the isomorphism between streams and functions from the natural numbers means that stream
by chas 11y ago
Speaking of things that the Haskell type system lets you make explicit, the isomorphism between streams and functions from the natural numbers means that streams are "representable functors" in the jargon of category theory. [1] Knowing that a data type is representable allows you to immediately build a bunch of other interesting structures on the data type. [0]
[0] http://covariant.me/notes/rep-functors.html http://covariant.me/notes/rep-functors.html
[1] https://pamiz.wordpress.com/2014/02/13/the-functor-of-infinite-lists-is-representable-by-natural-numbers/ https://pamiz.wordpress.com/2014/02/13/the-functor-of-infini...
- catnaroek 11y agoNitpick on both links. They say `alpha . beta = id = beta . alpha`. This is wrong: `alpha . beta` composes to a different `id` from `beta . alpha`.