lue-bird / elm-review-missing-record-field-lens

elm-review: helper generation
https://package.elm-lang.org/packages/lue-bird/elm-review-missing-record-field-lens/latest/
MIT License
2 stars 1 forks source link

upgrade to `type alias Optional` when defined #3

Open lue-bird opened 2 years ago

lue-bird commented 2 years ago

In the future, when @erlandsona defines a Prism type from Relations, update the generated variant prism declaration type annotations accordingly.

erlandsona commented 2 years ago

So I'm not entirely sure how to properly define that type such that it satisfies the laws AND remains composable with other type aliases. There's also a "structure preserving" vs "non structure preserving" property to account for where an "Optional" could be defined with a couple different signatures... see def and or. or has to be written in terms of another lens in order to satisfy the type... eg: get (someLens |> or "Some Default") --> "Some Default" but get (someLens << def "Some Default") --> "Some Default"

I could certainly pick one, and figure out suggestions for other use cases but it's not clear currently which situation is more common.