Open
Description
hugr-model
represents constants for a runtime type ?t
as terms of the static type (core.const ?t)
. To ease the migration from JSON encoded to term encoded constants, we should add the ability to represent the type of constants in TypeParam
.
This could be done, as it is in hugr-model
, via custom constructors. However, to avoid having to figure out custom TypeParam
s first (#2296), we can special case this (for now) as follows:
pub enum TypeParam {
// ...
/// The type of runtime constants.
Const {
runtime_type: Type,
}
}
In particular, resolving this issue would require:
- Add a
Const
variant toTypeParam
as above. - Add a
ConstTypeParam
to the Python bindings. - Write the Rust
model
tocore
import code that imports(core.const ?t)
asTypeParam::Const
. - Write the Rust
core
tomodel
export code that exportsTypeParam::Const
to(core.const ?t)
. - Write the Python
core
tomodel
export code that exportsConstTypeParam
to(core.const ?t)
. - Update the spec accordingly.
Metadata
Metadata
Assignees
Labels
No labels