Profunctor Equipment in Haskell
The article discusses the implementation of profunctor equipment in Haskell. It emphasizes the advantages of using a compiler-verified encoding while acknowledging the limitations of Haskell compared to dependently typed languages. The author provides various definitions and examples related to functors and profunctors, highlighting their applications in Haskell programming.
- ▪The implementation aims to make profunctor equipment more accessible for programmers.
- ▪It utilizes the Haskell category of types and functions along with standard library implementations.
- ▪The article includes definitions for horizontal and vertical compositions of cells using profunctors.
Opening excerpt (first ~120 words) tap to expand
Previously: Profunctor Equipment. To make things more palatable for programmers, I decided to provide a toy implementation of some of the equipments in Haskell. The advantage of this encoding is that it can be verified by the compiler, and I still trust the compiler more than I trust the AI. A more adequate implementation would require a full-blown dependently typed language, but if we restrict ourselves to just a single category and work only with endo-functors and endo-profunctors, we can get at least some intuitions. If you want to see a more elaborate version, see the proarrows library by Sjoerd Visscher. The only 0-cell I’ll be using is the Haskell category of types and functions.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Bartosz Milewski's Programming Cafe.