Open guaraqe opened 4 years ago
I just checked and it seems that the same error due to Functor
and Monad
happens in the Traversing
class, that was not touched in this PR. If compatibility with GHC 7.8 is not required, I can remove the workaround I mentioned above in the Kleisli
instance.
This adds the
reach
function to theStrong
class. It has the following type:It has two uses:
It allows the definition of more efficient
Profunctor
-transformation functions, since it can avoid the construction of tuples demanded by the other functions in this class.It acts as a compatibility layer with lenses, without the need for extra dependencies. The first parameter of the function is essentially the definition of a
Lens
. The default definition of 'first'', for example, is:It is mutually defined in terms of
second'
, andfirst'
was modified to be defined in terms ofreach
, which means that no existing code should break.I had to add a
Functor
dependency to theKleisli
instance forStrong
to satify older versions of GHC. I don't know if this is the best solution.