A Neighborhood of Infinity: The Monads Hidden Behind Every Zipper

A Neighborhood of Infinity google_ad_section_start(name=default) Friday, January 26, 2007 The Monads Hidden Behind Every Zipper Uustalu points out that behind every zipper lies a comonad. I used this in my cellular automaton example . What he doesn't mention is that there is also a monad lurking behind every zipper and that it arises in a natural way. The catch is that it's a monad in the wrong category making it tricky to express in Haskell. Firstly, what does "wrong category" mean? In the category of vector spaces, every object is equipped with a commutative binary + operator. We can make no such assumption in Haskell. What's more, Haskell doesn't easily allow us to restrict type constructors to instances of Num say. So we can't easily implement monads in the category of vector spaces as instances of Haskell's Monad bind return Num convolution > data Zip...

Linked on 2015-03-15 23:02:00 | Similar Links