-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat!: Allow "Row Variables" declared as List<Type> #804
Merged
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
7b242ac
Refactor: break out fn valid_row for validating a TypeRow
acl-cqc ba05010
Type::{validate,substitute}_in_row, {Substitution,SubstValues}::apply…
acl-cqc 59c5854
[test] types.rs::construct - also validate
acl-cqc 72b4fb2
[tests] poly_func.rs: test row variables
acl-cqc 2cf1e7f
[test] validate Hugr passing around Function of unknown arity
acl-cqc 8899806
[tests]Validation prevents row variables being used in node signatures
acl-cqc e1f1825
Simplify default apply_typevar_in_row
acl-cqc 1074093
Separate TypeEnum::RowVariable
acl-cqc 4291848
Merge remote-tracking branch 'origin/main' into feat/row_typevar
acl-cqc 98c75a2
Doc updates - no DeBruijn, ref OpDef vs FuncDefn
acl-cqc b918bee
Remove unused test setup changes
acl-cqc a096f1a
Merge remote-tracking branch 'origin/main' into feat/row_typevar
acl-cqc 4b0e23f
Combine Type::substitute(_in_row), doc, add TODOs
acl-cqc a0aba20
FunctionType/PolyFuncType validate_varargs (fixed-len not reqd)
acl-cqc bd0689f
Type::validate(=>_1type), fix TypeParam to call validate_in_row
acl-cqc 72f4b98
{subst,valid}_row => TypeRow::{substitute,validate_var_len}
acl-cqc d9653aa
Normalize representation of row variable as TypeArg; extend check_typ…
acl-cqc 15bf177
Test bad schema, test can't fit row variable into type hole
acl-cqc bc11c68
Extend validation tests using eval+parallel
acl-cqc f39373b
And extend no_outer_row_variables to include unconnected out'port's o…
acl-cqc bd39303
comments re. canonicalization, tests
acl-cqc ed64d12
clippy
acl-cqc d02c9c0
single_type_seq -> seq1ty
acl-cqc 50b9c85
Merge remote-tracking branch 'origin/main' into feat/row_typevar
acl-cqc 742ab55
Combine helpers giving extension_with_eval_parallel
acl-cqc ce72762
Add RowVar to serialization/tys.py
acl-cqc c556a8a
Regenerate schema
acl-cqc 7214cbc
Really regenerate schema (after poetry install)
acl-cqc ce28154
Use Vec<TypeArg> .into() -> TypeArg
acl-cqc 0e4b232
Add TypeParam::new_list
acl-cqc 5b39b9c
rowparam() -> rowp.clone()
acl-cqc 9ae2255
new_row_var => new_row_var_use, some cleanups using .into()
acl-cqc 412ec08
squash! Add TypeParam::new_list
acl-cqc 34ed4c9
Fix apply_row_var...TODO cover this
acl-cqc 85d1969
check_type_arg_rv: improve comment
acl-cqc 3cf333d
Remove rowvar_in_list using TypeParam::contains
acl-cqc 2929135
Add Type::row_var_bound
acl-cqc 0afdaf9
Remove check_type_arg_rv
acl-cqc 5a8bf88
Use Type .into() -> TypeArg more
acl-cqc 2e53529
Extend comment that TypeArg::Variable's are not row-vars
acl-cqc ed09ae6
type_row.rs: comment ...Variable]*s*
acl-cqc 8c93c9d
Add check_type_arg tests as rstest cases
acl-cqc 8811e1a
More tests! (giving up on rstest)
acl-cqc d728714
Add a couple of PolyFuncType-serialization tests
acl-cqc 9af9d01
In validation, panic upon malformed TypeArgVariable
acl-cqc ef86cd7
Correct comment in TypeArg::new_var_use
acl-cqc 0ff4a05
Add anti-row-var checks in TypeRow::get/get_mut
acl-cqc b9fc1cf
Make TypeRow::get(_mut) pub only to crate::types
acl-cqc bcffd57
Revert "Make TypeRow::get(_mut) pub only to crate::types"
acl-cqc 98cf6af
row_var_bound -> is_row_var
acl-cqc 4a41f96
Clarify bound in Type::new_(,row_)var_use
acl-cqc 5359441
Thank you Doug!
acl-cqc fdb19ae
Comments (Function values, "must match" => "must be exactly")
acl-cqc d949cc9
Another TypeParam::new_list
acl-cqc 571d025
Test: p -> seq_param
acl-cqc a353026
Test: rowvar = Type::new_row_var_use
acl-cqc 93536b3
Capture TypeArg::Type substituting-to-multiple in a unit test, fix
acl-cqc d339e2c
Another test with a list-of-list-of-type
acl-cqc 71b3ae2
Use vec![].into() somewhat selectively
acl-cqc b77e3c8
Merge 'origin/main' into feat/row_typevar. Proptest failing...
acl-cqc 91317ae
Fix proptest by local reject
acl-cqc 3cbccc7
Temp remove TypeRow checks
acl-cqc a43e0a1
Merge remote-tracking branch 'origin/main' into feat/row_typevar
acl-cqc e0c7162
Add non-debug asserts in FunctionType
acl-cqc 7ebb596
Combine Type::validate_1type / validate_in_row to validate(bool,...)
acl-cqc bc2d358
validate_varargs => validate_var_len
acl-cqc 5b63d0c
RowVarOutsideRow => RowVarWhereTypeExpected
acl-cqc 2a28052
check_no_rowvars - ignore index, check whole row - breaks no_outer_ro…
acl-cqc c559abc
FunctionType::find_row_var, check in builder and validation (before p…
acl-cqc 98c1fc9
Tests (rewrite w/out builder; add builder test, using now-pub-crate e…
acl-cqc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this should be pub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to have
has_rowvars(&self) -> bool
and thought that definitely should bepub
. Then I realized that when it returnedtrue
I'd have to scan through to find one to raise the error I wanted, so why not do that in the same go. I think having some kind of are-there-any-rowvars is a good method to have, I agree this is a slightly non-obvious form for it but it's no worse than thebool
one no?Could return a list of vars, or
Vec<(Direction, usize, (usize, TypeBound)>
(i.e. where each one was found) or something like that I guess?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the return type it's that I don't think this will have any users, so preferring not to pollute the namespace + docs. If you disagree, no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a query method, yes. When we split FunTypeVarArgs and SignatureType it belongs only on the former (as necessarily false/None for Signature).