-
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
refactor!: Separate Signature from FunctionType #1044
Conversation
20346f3
to
9f53329
Compare
hugr/src/extension/op_def.rs
Outdated
@@ -24,7 +24,7 @@ pub trait CustomSignatureFunc: Send + Sync { | |||
arg_values: &[TypeArg], | |||
def: &'o OpDef, | |||
extension_registry: &ExtensionRegistry, | |||
) -> Result<PolyFuncType, SignatureError>; | |||
) -> Result<PolyFuncType<true>, SignatureError>; |
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.
@acl-cqc I think this should be false?
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.
We don't substitute args into the signature in SignatureFunc::compute_signature
, but I think we could? I think this would make all uses of PolyFuncType
disallow row variables (excepting perhaps funcdecl).
EDIT: no, I am confuesed
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.
For an OpDef, we allow row variables in the type scheme (i.e. any time it's polymorphic), as long as they are gone by the time we have a node Signature. We could possibly do that final substitution + (fallible-)conversion-to-Signature inside compute_signature
but we'll still need a PolyFuncType somewhere even if maybe not as public as this. (We allow custom binary compute-signature functions to return a PolyFuncType<true>
if they want.)
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.
Sorry I was unclear above. Yes I eventually came to understand that row variables should be allowed here.
Hey there and thank you for opening this pull request! 👋🏼 It looks like your proposed title indicates a breaking change. If that's the case, |
…kes impl Into, update Dataflow/Ops etc.
4e94de4
to
cac4efb
Compare
cac4efb
to
2b8f0ef
Compare
Hey there and thank you for opening this pull request! 👋🏼 It looks like your proposed title indicates a breaking change. If that's the case, |
Closing in favour of #1138 |
Goal is to solve #1094 but not even building yet!
Plan?
inputs
,outputs
andextension_reqs
non-pub
in a first PR, we should probably do that anywayFunctionType::new(...)
(that although nominally variable-length, don't actually contain any row-vars)?