Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to type alias Optional when defined #3

Open
lue-bird opened this issue May 20, 2022 · 1 comment
Open

upgrade to type alias Optional when defined #3

lue-bird opened this issue May 20, 2022 · 1 comment

Comments

@lue-bird
Copy link
Owner

lue-bird commented May 20, 2022

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

@lue-bird lue-bird changed the title @erlandsona: upgrade when a type alias Optional has been figured out upgrade to type alias Optional when defined May 20, 2022
@erlandsona
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants