Fri May 17 09:56:58 EDT 2019

Annotating functors

Is this a general pattern / idiom?

1. Often is is terribly convenient to shoe-horn a data structure into
Functor, Foldable, Traversable interfaces.  However, this abstracts
away context information.

2. To work around this, provide a custom iteration that does nothing
but adding a context record to each element inside the Functor that
"inverts" all the references to the outside world, from the
perspective of that element.  I.e.  F a -> F (Ctx, a).  Basically, Ctx
is some kind of zipper-like structure.