I notice that the Representable class define an isomorphism (between the functor and its representation), but that you avoid defining it in terms if lens's Iso. Is there a reason for this?
I have been using the following in my own code but I would rather it was in an official package.
import Control.Lens
import Data.Functor.Rep
tabulated :: Representable f => Iso (Rep f -> a) (Rep f -> b) (f a) (f b)
tabulated = iso tabulate index
Hi Edward,
I notice that the
Representable
class define an isomorphism (between the functor and its representation), but that you avoid defining it in terms iflens
'sIso
. Is there a reason for this?I have been using the following in my own code but I would rather it was in an official package.