Open 3noch opened 6 years ago
I would also like to see comparison with microlens
.
Yes, you should be able to drop this in as a replacement for lens
once it's done, since I'm changing as little of the API as I can, but, no, it isn't feature-complete yet. Once it is done, it should be exactly equal in power to lens
since that's what I'm porting. (So, for any comparisons with microlens
, just compare it to lens
.)
Downsides:
-lens
libraries (e.g. lens-aeson
) will have to be ported. This is pretty easy: any provided lenses will just have to be wrapped in the fromRaw*
functions:-import Control.Lens
+import Silica
foo :: Lens' Foo Bar
-foo = whatever
+foo = fromRawLens whatever
fromRawLens has the type R_Lens s t a b -> Lens s t a b
, where R_Lens
is the type that lens
provides.
What about performance?
Maybe inspection-testing
library can help with ensuring good performance...
When you're asking about performance, it's important to specify what performance you're talking about. If you're talking about the performance of developers' efficiency in producing working and adaptable code, then this library is already leaps and bounds beyond lens
.
I would be very interested in using this, so it would be nice if it were updated to support newer versions of GHC.
@RobertFischer I've not actually had any significant trouble using lens
as is when it comes to developer productivity. But I would definitely prefer a more beginner friendly tool if it doesn't degrade other aspects of my code (namely, run-time performance).
Could someone use this instead of
lens
? Are there downsides?