well-typed / optics

Optics as an abstract interface
375 stars 24 forks source link

Minimal definition of Profunctor #255

Open kcsongor opened 5 years ago

kcsongor commented 5 years ago

At the moment, in order to define a Profunctor instance, one needs to write all of dimap, lmap an rmap functions, but the latter two can be implemented in terms of the first two (and vice versa). I wonder if there's a reason for not including these default implementation in the class?

arybczak commented 5 years ago

My reasoning was to avoid defaults and "inline" the definitions by hand so that compiler has less work to do.