Skip to content

Commit

Permalink
Doc updates - no DeBruijn, ref OpDef vs FuncDefn
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Apr 15, 2024
1 parent 4291848 commit 98c75a2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hugr/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub enum TypeEnum {
#[allow(missing_docs)]
#[display(fmt = "Variable({})", _0)]
Variable(usize, TypeBound),
/// DeBruijn index, and cache of inner TypeBound - matches a [TypeParam::List] of [TypeParam::Type]
/// Variable index, and cache of inner TypeBound - matches a [TypeParam::List] of [TypeParam::Type]
/// of this bound (checked in validation)
#[display(fmt = "RowVar({})", _0)]
RowVariable(usize, TypeBound),
Expand Down Expand Up @@ -317,9 +317,13 @@ impl Type {
Self(TypeEnum::Variable(idx, bound), bound)
}

/// New use (occurrence) of the row variable with specified DeBruijn index.
/// For use in type schemes only: `bound` must match that with which the
/// variable was declared (i.e. as a [TypeParam::List]`(`[TypeParam::Type]`(bound))`).
/// New use (occurrence) of the row variable with specified index.
/// `bound` must match that with which the variable was declared
/// (i.e. as a [TypeParam::List]` of a `[TypeParam::Type]` of that bound).
/// For use in [OpDef], not [FuncDefn], type schemes only.
///
/// [OpDef]: crate::extension::OpDef
/// [FuncDefn]: crate::ops::FuncDefn
pub const fn new_row_var(idx: usize, bound: TypeBound) -> Self {
Self(TypeEnum::RowVariable(idx, bound), bound)
}
Expand Down

0 comments on commit 98c75a2

Please sign in to comment.