monocle-ts icon indicating copy to clipboard operation
monocle-ts copied to clipboard

Is there any future for monocle-ts?

Open goce-cz opened this issue 1 year ago • 5 comments

Hello @gcanti,

First of all, thank you for your enormous contribution to the open-source world and for evangelizing functional programming in TypeScript.

We're currently contemplating adoption of monocle-ts in a mission critical long term project and we see a big potential benefit in it. However we are noticeably concerned about the future of the library as you seem to be stretched pretty thin now. No activity in more than a year and 3 years old experimental API, which should IMO clearly be the default one - kudos for taking the brave step - is a factor that troubles us.

So, I just wanted to ask you: Do you find it realistic for you to keep maintaining the library? Is there a plan of promoting the experimental API to the default one?

Thank you in advance for replying. Any kind of answer will be appreciated.

Best regards, Jiří

goce-cz avatar Jul 31 '23 09:07 goce-cz

Hello @goce-cz, I am working full-time on Effect-TS, so I don't have much time to devote to monocle-ts and I need to reduce maintenance to a minimum. In short, this means:

  • Bug fixes? Yes
  • New developments? No

gcanti avatar Jul 31 '23 16:07 gcanti

Thank you very much for your reply, @gcanti, at least we know where we stand.

Sad to hear that though. :cry:

Any chance we might be getting optics as part of the Effect-TS any time soon? I found a tiny mention in one of the issues, so I remain hopeful.

goce-cz avatar Aug 01 '23 06:08 goce-cz

A few months ago we worked on an optics library for Effect, it's still in the fp-ts org though (*): https://github.com/fp-ts/optic.

The interesting thing about this new encoding is that there is only one type Optic from which all the other optics can be derived as subtypes, which makes it possible, among other things, to compose optics with a single compose method without the hassle of importing n different modules as in monocle-ts.

(*)

However, the situation is perhaps even worse than that of monocle-ts in terms of reliability, as we don't believe that it is worth maintaining an optics library for Effect as it is a very niche area.

gcanti avatar Aug 01 '23 14:08 gcanti

@gcanti What were the issues around reliability? Do you think it would be better to bet on it over the Monocle experimental API?

I've been considering forking the Monocle experimental API but updating to work with Effect instead of fp-ts. I expect it won't be very hard. Any thoughts on this idea? FWIW Monocle already works pretty well with Effect, it's mostly things like getOption that are annoying to work with.

I'm quite reliant on optics - I have a large deeply nested data structure that I understand is supposed to be bad design but it has served us incredibly well over many years and has enabled huge changes to our product with minimal effort, especially when it comes to data migrations.

kalda341 avatar Aug 02 '23 05:08 kalda341

What were the issues around reliability?

@kalda341 I mean that @fp-ts/optic is not currently being maintained, and it is unlikely that it will be maintained in the future unless it is absorbed by the effect org.

I've been considering forking the Monocle experimental API but updating to work with Effect instead of fp-ts. I expect it won't be very hard. Any thoughts on this idea?

Forking the Monocle experimental API should not be difficult. If you have a lot of code based on monocle-ts, this may be the best option for you, especially if you are using traversals, which are not yet fully implemented in @fp-ts/optic.

gcanti avatar Aug 02 '23 13:08 gcanti