lenses-ppx icon indicating copy to clipboard operation
lenses-ppx copied to clipboard

Inspired by #10

Open erlandsona opened this issue 4 years ago • 2 comments

What about generating Prisms, Traversals, or other optics? I'm also curious about how these compose... I've got some heavy enough usage of nested |> Option.map(x => x.prop) and |> Option.flatMap(x => x.prop) stuff, and I'm wondering if making use of this library might give me some better ergonomics.

erlandsona avatar Jun 02 '20 14:06 erlandsona

That is a nice idea, let's discuss how that would look like in here. What kind of usage are you thinking on?

fakenickels avatar Jun 02 '20 17:06 fakenickels

Honestly, I don't have much experience with them given we've only just started using Reason at my company the past few months and I only have experience doing Haskell in my free time so I never used the lense lib but I know of it, why it exists, and this would be my first experience getting to put lenses in production so mostly I was looking for some larger scale examples.

Based on my limited understanding of Optics Prism's would give us the ability to handle custom variants as options and Traversals for say rendering an list of say html `li's?

erlandsona avatar Jun 02 '20 17:06 erlandsona