@@ -17,13 +17,13 @@ use {crate::proptest::RecursionDepth, ::proptest::prelude::*, proptest_derive::A
17
17
18
18
#[ derive( Clone , Debug , Eq , serde:: Serialize , serde:: Deserialize ) ]
19
19
#[ cfg_attr( test, derive( Arbitrary ) , proptest( params = "RecursionDepth" ) ) ]
20
- /// Describes the edges required to/from a node (when ROWVARS=false );
21
- /// or (when ROWVARS=true ) the type of a [Graph ] or the inputs/outputs from an OpDef
20
+ /// Describes the edges required to/from a node or inside a [FuncDefn] (when ROWVARS=[NoRV] );
21
+ /// or (when ROWVARS=[RowVariable] ) the type of a higher-order [function value ] or the inputs/outputs from an OpDef
22
22
///
23
23
/// ROWVARS specifies whether it may contain [RowVariable]s or not.
24
24
///
25
- /// [Graph ]: crate::ops::constant::Value::Function
26
- /// [RowVariable ]: crate::types::TypeEnum::RowVariable
25
+ /// [function value ]: crate::ops::constant::Value::Function
26
+ /// [FuncDefn ]: crate::ops::FuncDefn
27
27
pub struct FuncTypeBase < ROWVARS : MaybeRV > {
28
28
/// Value inputs of the function.
29
29
#[ cfg_attr( test, proptest( strategy = "any_with::<TypeRowBase<ROWVARS>>(params)" ) ) ]
@@ -35,12 +35,17 @@ pub struct FuncTypeBase<ROWVARS: MaybeRV> {
35
35
pub extension_reqs : ExtensionSet ,
36
36
}
37
37
38
- /// The concept of "signature" in the spec - the edges required to/from a node or graph
39
- /// and also the target (value) of a call (static).
38
+ /// The concept of "signature" in the spec - the edges required to/from a node
39
+ /// or within a [FuncDefn], also the target (value) of a call (static).
40
+ ///
41
+ /// [FuncDefn]: crate::ops::FuncDefn
40
42
pub type FunctionType = FuncTypeBase < NoRV > ;
41
43
42
44
/// A function that may contain [RowVariable]s and thus has potentially-unknown arity;
43
- /// passable as a value round a Hugr (see [Type::new_function]) but not a valid node type.
45
+ /// used for [OpDef]'s and passable as a value round a Hugr (see [Type::new_function])
46
+ /// but not a valid node type.
47
+ ///
48
+ /// [OpDef]: crate::extension::OpDef
44
49
pub type FunctionTypeRV = FuncTypeBase < RowVariable > ;
45
50
46
51
impl < RV : MaybeRV > FuncTypeBase < RV > {
@@ -63,7 +68,7 @@ impl<RV: MaybeRV> FuncTypeBase<RV> {
63
68
Self {
64
69
input : input. into ( ) ,
65
70
output : output. into ( ) ,
66
- extension_reqs : ExtensionSet :: default ( ) ,
71
+ extension_reqs : ExtensionSet :: new ( ) ,
67
72
}
68
73
}
69
74
0 commit comments