Skip to content

Commit eb3e86c

Browse files
committed
TypeScheme(RV/Base) back to PolyFuncType(RV/Base)
1 parent 3245b45 commit eb3e86c

File tree

21 files changed

+155
-155
lines changed

21 files changed

+155
-155
lines changed

hugr-core/src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub(crate) mod test {
235235
use crate::hugr::{views::HugrView, HugrMut};
236236
use crate::ops;
237237
use crate::std_extensions::arithmetic::float_ops::FLOAT_OPS_REGISTRY;
238-
use crate::types::{FunctionType, Type, TypeScheme};
238+
use crate::types::{FunctionType, PolyFuncType, Type};
239239
use crate::{type_row, Hugr};
240240

241241
use super::handle::BuildHandle;
@@ -258,7 +258,7 @@ pub(crate) mod test {
258258
}
259259

260260
pub(super) fn build_main(
261-
signature: TypeScheme,
261+
signature: PolyFuncType,
262262
f: impl FnOnce(FunctionBuilder<&mut Hugr>) -> Result<BuildHandle<FuncID<true>>, BuildError>,
263263
) -> Result<Hugr, BuildError> {
264264
let mut module_builder = ModuleBuilder::new();

hugr-core/src/builder/build_traits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{
1919
};
2020

2121
use crate::extension::{ExtensionRegistry, ExtensionSet, PRELUDE_REGISTRY, TO_BE_INFERRED};
22-
use crate::types::{FunctionType, Type, TypeArg, TypeRow, TypeScheme};
22+
use crate::types::{FunctionType, PolyFuncType, Type, TypeArg, TypeRow};
2323

2424
use itertools::Itertools;
2525

@@ -78,7 +78,7 @@ pub trait Container {
7878
fn define_function(
7979
&mut self,
8080
name: impl Into<String>,
81-
signature: impl Into<TypeScheme>,
81+
signature: impl Into<PolyFuncType>,
8282
) -> Result<FunctionBuilder<&mut Hugr>, BuildError> {
8383
let signature = signature.into();
8484
let body = signature.body().clone();

hugr-core/src/builder/dataflow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::marker::PhantomData;
77
use crate::hugr::{HugrView, ValidationError};
88
use crate::ops;
99

10-
use crate::types::{FunctionType, TypeScheme};
10+
use crate::types::{FunctionType, PolyFuncType};
1111

1212
use crate::extension::ExtensionRegistry;
1313
use crate::Node;
@@ -140,7 +140,7 @@ impl FunctionBuilder<Hugr> {
140140
/// Error in adding DFG child nodes.
141141
pub fn new(
142142
name: impl Into<String>,
143-
signature: impl Into<TypeScheme>,
143+
signature: impl Into<PolyFuncType>,
144144
) -> Result<Self, BuildError> {
145145
let signature = signature.into();
146146
let body = signature.body().clone();
@@ -527,7 +527,7 @@ pub(crate) mod test {
527527
// Can *declare* a function that takes a function-value of unknown #args
528528
FunctionBuilder::new(
529529
"bad_eval",
530-
TypeScheme::new(
530+
PolyFuncType::new(
531531
[TypeParam::new_list(TypeBound::Copyable)],
532532
FunctionType::new(
533533
Type::new_function(FunctionTypeRV::new(USIZE_T, tv.clone())),

hugr-core/src/builder/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::hugr::internal::HugrMutInternals;
99
use crate::hugr::views::HugrView;
1010
use crate::hugr::ValidationError;
1111
use crate::ops;
12-
use crate::types::{Type, TypeBound, TypeScheme};
12+
use crate::types::{PolyFuncType, Type, TypeBound};
1313

1414
use crate::ops::handle::{AliasID, FuncID, NodeHandle};
1515

@@ -100,7 +100,7 @@ impl<T: AsMut<Hugr> + AsRef<Hugr>> ModuleBuilder<T> {
100100
pub fn declare(
101101
&mut self,
102102
name: impl Into<String>,
103-
signature: TypeScheme,
103+
signature: PolyFuncType,
104104
) -> Result<FuncID<false>, BuildError> {
105105
// TODO add param names to metadata
106106
let declare_n = self.add_child_node(ops::FuncDecl {

hugr-core/src/extension/declarative/signature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use smol_str::SmolStr;
1414
use crate::extension::prelude::PRELUDE_ID;
1515
use crate::extension::{ExtensionSet, SignatureFunc, TypeDef};
1616
use crate::types::type_param::TypeParam;
17-
use crate::types::{CustomType, FunctionTypeRV, Type, TypeRowRV, TypeSchemeRV};
17+
use crate::types::{CustomType, FunctionTypeRV, PolyFuncTypeRV, Type, TypeRowRV};
1818
use crate::Extension;
1919

2020
use super::{DeclarationContext, ExtensionDeclarationError};
@@ -56,7 +56,7 @@ impl SignatureDeclaration {
5656
extension_reqs: self.extensions.clone(),
5757
};
5858

59-
let poly_func = TypeSchemeRV::new(op_params, body);
59+
let poly_func = PolyFuncTypeRV::new(op_params, body);
6060
Ok(poly_func.into())
6161
}
6262
}

0 commit comments

Comments
 (0)