ekmett / adjunctions

Simple adjunctions
http://hackage.haskell.org/package/adjunctions
Other
44 stars 27 forks source link

Use lens Iso in Data.Functor.Rep #9

Closed hanshoglund closed 10 years ago

hanshoglund commented 10 years ago

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 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
ekmett commented 10 years ago

Done.

Merged a patch for this by @sjoerdvisscher.