A recent question led me to wonder how to convert a
forall f . Functor f => [LensLike f s t a b]
into a
[ReifiedLens s t a b]
There's an easy way to do it really slowly, by indexing into the list with !!
, but it's quite incredibly inefficient. It feels like there should be enough parametricity to pull a trick similar to the one used in reflection
, but I can't seem to figure anything out. Is it possible to do this efficiently at all?