Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use microlens instead of lens #109

Open
leptonyu opened this issue Jul 30, 2019 · 5 comments
Open

Use microlens instead of lens #109

leptonyu opened this issue Jul 30, 2019 · 5 comments

Comments

@leptonyu
Copy link

Lens is very heavy library, many libraries use microlens instead. Can you replace it?

@phadej
Copy link
Contributor

phadej commented Jul 30, 2019

I'm sorry, but the answer is no.

We (me and @alpmestan) agreed thatlens dependencies can be added to servant-* packages.
lens is virtually unavoidable in any non-trivial real worldservant applications, something in your dependencies transitively depends on it (even you don't use lens yourself) or you have to be extra careful when picking them.
E.g. servant-client depends on kan-extensions since recently.

Also it's swagger2 which pulls in lens and it defines Prisms in https://hackage.haskell.org/package/swagger2-2.4/docs/Data-Swagger-Lens.html, so profunctors would be needed with microlens ecosystem too.

There aren't many packages between profunctors and lens. Even less between kan-extensions and lens.

cabal, stack and nix are all good quite good at caching dependencies, and the acme-kmett is quite stable (new releases happen rarely).

@leptonyu
Copy link
Author

Thanks.

It seems acme-kmett's README.md needs a little modification.

GHC-8.6.4 -> GHC-8.6.5

@alpmestan
Copy link

alpmestan commented Jul 31, 2019

Right, I think it's a bit tricky for us to change this. But if I'm not mistaken, none of servant, servant-client[-core] nor servant-server depend on lens (transitively), do they? Only the -docs/-swagger/... packages do, IIRC. If we had an easy path towards becoming lens lib agnostic or another solution that would let us not depend on lens, we'd take it but I don't think that's the case, as explained by @phadej. If that changes, we can revisit this request. :-)

@neongreen
Copy link
Contributor

microlens itself is lens-lib-agnostic. As in, you don't lose anything by using microlens instead of lens — van Laarhoven lenses are compatible with each other.

If you are exporting prisms, though, you're better off with lens.

@akhesaCaro
Copy link
Contributor

Hi,
Servant-swagger will be moved into the main Servant repo (see : haskell-servant/servant#1475)
If this issue is still relevant, would it be possible for you to summit it there? : https://github.com/haskell-servant/servant/issues

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants