evertedsphere / silica

optics for Haskell with the most amazing type errors you've seen
BSD 3-Clause "New" or "Revised" License
243 stars 7 forks source link

Is this production-ready? #3

Open 3noch opened 6 years ago

3noch commented 6 years ago

Could someone use this instead of lens? Are there downsides?

chshersh commented 6 years ago

I would also like to see comparison with microlens.

mrkgnao commented 6 years ago

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:

-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.

3noch commented 6 years ago

What about performance?

chshersh commented 6 years ago

Maybe inspection-testing library can help with ensuring good performance...

RobertFischer commented 6 years ago

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.

anchpop commented 6 years ago

I would be very interested in using this, so it would be nice if it were updated to support newer versions of GHC.

3noch commented 6 years ago

@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).