Closed erlandsona closed 2 years ago
GenerateUsed
is slightly more clear than NoMissing
IMO (best would be GenerateMissingUsed
or sth)internal prism reference is a good idea are you motivated to implement this yourself? Otherwise, you might have to wait some time, sorry
It's what I had in the original PR see here for how I had implemented it before. https://github.com/lue-bird/elm-review-missing-record-field-lens/pull/2/files#diff-51ee51156bc0e70de37a9487fc4867daf98cb8a198b9d400d5cb974889677868
done, published
2 thoughts
rename: VariantLens.GenerateUsed -> NoMissingVariantPrism a. One because in Optics terms "Lenses" don't operate over Sum types / ADT's only "Product Types" aka records. Prisms operate over Sums/ADTS/Variants... b. To match better with NoMissingRecordFieldLens 🤷♂️
Generate Prisms inline below the definition of the Variant to not force the defining module to expose its constructors. EG: I'd like to "expose" some lenses for operating over say pieces of an otherwise opaque record... something like...