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

"flat" and "nested" kinds for query results #1140

Open
jamescheney opened this issue May 12, 2022 · 0 comments
Open

"flat" and "nested" kinds for query results #1140

jamescheney opened this issue May 12, 2022 · 0 comments
Labels
enhancement meta-issue Issue for tracking progress of other issues and pull requests

Comments

@jamescheney
Copy link
Contributor

This is a proposal to address #761 (which calls for typechecking nested query results to ensure that they are sensible nested types) and (the typechecking part of) #1127 (which calls for providing record flattening for all kinds of queries).

The proposal is to add two kind restrictions:

  • Flat which consists of base types or records of flat types. Thus if record flattening is implemented according to Record flattening for all queries #1127 the Flat restriction characterizes the allowed return types for the flat and mixed/delat policies.
  • Nested which consists of base types, records of nested types, or collections (lists) of nested types. This would characterize the allowed return types of nested queries.

We would also have subkinding relationships Base <: Flat <: Nested <: Mono. I believe checking the above restrictions would be straightforward: whenever we unify a flexible type variable with one of the above restrictions applied to it with something else, we check whether the newly unified structure makes use of any disallowed type constructors and constrain any type variables encountered along the way by min-ing with the subkind (similar to what already happens with Mono and Base).

I'd still rather have this happen as an instance of a general-purpose programmable mechanism like type classes, but that doesn't seem likely to happen in the near future.

@jamescheney jamescheney added enhancement meta-issue Issue for tracking progress of other issues and pull requests labels May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement meta-issue Issue for tracking progress of other issues and pull requests
Projects
None yet
Development

No branches or pull requests

1 participant