haskell,functor,category-theory,comonad
So, assuming f and g are proper functors, forall a. f a -> g a is a natural transformation. We could make it a bit prettier: type f ~> g = forall a. f a -> g a Natural transformations like this let us form a category of Haskell Functors,...
haskell,comonad,tying-the-knot
It's possible to build a graph from a zipper so that moving around on the graph doesn't require allocating new memory. This can be a performance improvement if you are going to hold on to multiple pointers into the structure. We'll start with the zipper for lists. data U a...
It's important if you can do other things with the type than simply extract from it. Intuitively, if the only thing you can do is extract the value, then the type only holds one value, so duplicating that one value is duplicating everything. This isn't true in general, and it's...