Astrocoders / lenses-ppx

GADT lenses
MIT License
105 stars 10 forks source link

Inspired by #10 #22

Open erlandsona opened 4 years ago

erlandsona commented 4 years ago

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.

fakenickels commented 4 years ago

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

erlandsona commented 4 years ago

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?