purescript-contrib / purescript-profunctor-lenses

Pure profunctor lenses
MIT License
144 stars 51 forks source link

Add generic prisms #137

Open amesgen opened 2 years ago

amesgen commented 2 years ago

Description of the change

Generic prisms, inspired by Haskell's generic-lens, see _Ctor.


Checklist:

MonoidMusician commented 2 years ago

Have you seen https://github.com/LiamGoodacre/purescript-generics-rep-optics? It also provides optics based on generics-rep.

amesgen commented 2 years ago

Ah cool, I was not aware of that library. It seems to need a few slight changes to compile again, and has some differences (like not supporting constructors with zero or more than one argument). While I thought it would be nice to have something dual to field in profunctor-lenses, one other route would be to create a PR to https://github.com/LiamGoodacre/purescript-generics-rep-optics.