Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed Mar 12, 2024
1 parent 2c1539c commit df0a3f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions quantinuum-hugr/src/ops/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ impl TypeApplication {
})
}
}

pub fn input(&self) -> &PolyFuncType {
&self.input
}

pub fn args(&self) -> &[TypeArg] {
&self.args
}

pub fn output(&self) -> &PolyFuncType {
&self.output
}
}

impl Default for LeafOp {
Expand Down
6 changes: 5 additions & 1 deletion quantinuum-hugr/src/types/type_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ impl UpperBound {
_ => false,
}
}

pub fn value(&self) -> &Option<NonZeroU64> {
&self.0
}
}

/// A *kind* of [TypeArg]. Thus, a parameter declared by a [PolyFuncType] (e.g. [OpDef]),
Expand Down Expand Up @@ -167,7 +171,7 @@ pub enum TypeArg {
/// Variable in a TypeArg, that is not a [TypeArg::Type] or [TypeArg::Extensions],
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
pub struct TypeArgVariable {
idx: usize,
pub idx: usize,
cached_decl: TypeParam,
}

Expand Down
4 changes: 2 additions & 2 deletions quantinuum-hugr/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ impl_box_clone!(CustomConst, CustomConstBoxClone);
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
/// A value stored as a serialized blob that can report its own type.
pub struct CustomSerialized {
typ: CustomType,
value: serde_yaml::Value,
pub typ: CustomType,
pub value: serde_yaml::Value,
extensions: ExtensionSet,
}

Expand Down

0 comments on commit df0a3f3

Please sign in to comment.