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

policy-lang: consider nullable vs optional #6

Open
jdygert-spok opened this issue Jan 3, 2025 · 0 comments
Open

policy-lang: consider nullable vs optional #6

jdygert-spok opened this issue Jan 3, 2025 · 0 comments
Labels
policy-lang Policy language design

Comments

@jdygert-spok
Copy link
Contributor

Currently, optional types cannot be nested, so it behaves more like a nullable. Perhaps we should lean into this and make it more like e.g. C#'s nullable types, where it is like an extra value of the type rather than a sum type. Alternatively, we could make it nestable.

Nullable bool: true | false | null
Optional bool: Some(true) | Some(false) | None

I think the main practical difference would be allowing coercion into nullable, like let x: nullable int = 42

@jdygert-spok jdygert-spok added the policy-lang Policy language design label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
policy-lang Policy language design
Projects
None yet
Development

No branches or pull requests

1 participant