From a8fa01d0a99714babae8ef7e53dd636eb685abb7 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Mon, 1 Jul 2024 11:57:40 +0100 Subject: [PATCH] fix: some typos found using `typos` cli --- _typos.toml | 5 +++++ hugr-core/src/extension/prelude.rs | 2 +- hugr-core/src/hugr/views/sibling_subgraph.rs | 2 +- hugr-core/src/proptest.rs | 2 +- hugr-core/src/types/type_param.rs | 12 ++++++------ hugr-passes/src/const_fold/test.rs | 2 +- specification/hugr.md | 6 +++--- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/_typos.toml b/_typos.toml index d5d8f06c2..98af6e1aa 100644 --- a/_typos.toml +++ b/_typos.toml @@ -2,3 +2,8 @@ bck = "bck" # BiMap uses abbreviation ser_it = "ser_it" SerCollection = "SerCollection" +strat = "strat" # common abbreviation for strategy +# some arithmetic op names: +inot = "inot" +fle = "fle" +ine = "ine" diff --git a/hugr-core/src/extension/prelude.rs b/hugr-core/src/extension/prelude.rs index b2981a3b3..b67a4e39d 100644 --- a/hugr-core/src/extension/prelude.rs +++ b/hugr-core/src/extension/prelude.rs @@ -350,7 +350,7 @@ pub struct ConstExternalSymbol { pub symbol: String, /// The type of the value found at this symbol reference. pub typ: Type, - /// Whether the value at the symbol referenence is constant or mutable. + /// Whether the value at the symbol reference is constant or mutable. pub constant: bool, } diff --git a/hugr-core/src/hugr/views/sibling_subgraph.rs b/hugr-core/src/hugr/views/sibling_subgraph.rs index 889e5e5ae..fee4af9df 100644 --- a/hugr-core/src/hugr/views/sibling_subgraph.rs +++ b/hugr-core/src/hugr/views/sibling_subgraph.rs @@ -213,7 +213,7 @@ impl SiblingSubgraph { /// The in- and out-arity of the signature will match the /// number of incoming and outgoing edges respectively. In particular, the /// assumption is made that no two incoming edges have the same source - /// (no copy nodes at the input bounary). + /// (no copy nodes at the input boundary). pub fn try_from_nodes( nodes: impl Into>, hugr: &impl HugrView, diff --git a/hugr-core/src/proptest.rs b/hugr-core/src/proptest.rs index 344b32a70..5598cf75e 100644 --- a/hugr-core/src/proptest.rs +++ b/hugr-core/src/proptest.rs @@ -10,7 +10,7 @@ use crate::Hugr; /// [TypeParam], as well as several others, form a mutually recursive hierarchy. /// /// The proptest [proptest::strategy::Strategy::prop_recursive] is inadequate to -/// generate values for these types. Instead, ther Arbitrary instances take a +/// generate values for these types. Instead, the Arbitrary instances take a /// `RecursionDepth` as their (or part of their) /// [proptest::arbitrary::Arbitrary::Parameters]. We then use that parameter to /// generate children of that value. Usually we forward it unchanged, but in diff --git a/hugr-core/src/types/type_param.rs b/hugr-core/src/types/type_param.rs index e7019fe7c..f4e3876bd 100644 --- a/hugr-core/src/types/type_param.rs +++ b/hugr-core/src/types/type_param.rs @@ -105,7 +105,7 @@ impl TypeParam { } } - /// Make a new `TypeParam::List` (an arbitrary-length homogenous list) + /// Make a new `TypeParam::List` (an arbitrary-length homogeneous list) pub fn new_list(elem: impl Into) -> Self { Self::List { param: Box::new(elem.into()), @@ -232,7 +232,7 @@ impl TypeArg { // 1. TypeArg::Variable(idx, TypeParam::List(TypeParam::Type(typebound))) // 2. TypeArg::Type(Type::new_row_var_use(idx, typebound)) // Here we prefer the latter for canonicalization: TypeArgVariable's fields are non-pub - // so this pevents constructing malformed cases like the former. + // so this prevents constructing malformed cases like the former. let TypeParam::Type { b } = *bx else { panic!() }; Type::new_row_var_use(idx, b).into() } @@ -484,15 +484,15 @@ mod test { #[test] fn type_arg_fits_param() { let rowvar = Type::new_row_var_use; - fn check(arg: impl Into, parm: &TypeParam) -> Result<(), TypeArgError> { - check_type_arg(&arg.into(), parm) + fn check(arg: impl Into, param: &TypeParam) -> Result<(), TypeArgError> { + check_type_arg(&arg.into(), param) } fn check_seq>( args: &[T], - parm: &TypeParam, + param: &TypeParam, ) -> Result<(), TypeArgError> { let arg = args.iter().cloned().map_into().collect_vec().into(); - check_type_arg(&arg, parm) + check_type_arg(&arg, param) } // Simple cases: a TypeArg::Type is a TypeParam::Type but singleton sequences are lists check(USIZE_T, &TypeBound::Eq.into()).unwrap(); diff --git a/hugr-passes/src/const_fold/test.rs b/hugr-passes/src/const_fold/test.rs index 60a9ea4cf..438c2abcf 100644 --- a/hugr-passes/src/const_fold/test.rs +++ b/hugr-passes/src/const_fold/test.rs @@ -229,7 +229,7 @@ fn orphan_output() { // x2 := or(x0,x1) // output x2 == true; // - // We arange things so that the `or` folds away first, leaving the not + // We arrange things so that the `or` folds away first, leaving the not // with no outputs. use hugr_core::ops::handle::NodeHandle; diff --git a/specification/hugr.md b/specification/hugr.md index 7dad8b064..127e0635a 100644 --- a/specification/hugr.md +++ b/specification/hugr.md @@ -186,7 +186,7 @@ these are listed in [hierarchical node relationships](#hierarchical-relationships-and-constraints). In a valid HUGR the hierarchy edges form a tree joining all nodes of the HUGR, with a unique root node. The HUGR is characterized by the type of its root node. -The root node has no non-hierarchy edges (and this supercedes any other requirements on the +The root node has no non-hierarchy edges (and this supersedes any other requirements on the edges of specific node types). A *sibling graph* is a subgraph of the HUGR containing all nodes with @@ -837,7 +837,7 @@ such declarations may include (bind) any number of type parameters, of kinds as TypeParam ::= Type(Any|Copyable|Eq) | BoundedUSize(u64|) -- note optional bound | Extensions - | List(TypeParam) -- homogenous, any sized + | List(TypeParam) -- homogeneous, any sized | Tuple([TypeParam]) -- heterogenous, fixed size | Opaque(Name, [TypeArg]) -- e.g. Opaque("Array", [5, Opaque("usize", [])]) ``` @@ -1694,7 +1694,7 @@ including the names of the operations. Where WebAssembly specifies a "partial" operation (i.e. when the result is not defined on certain inputs), we use a Sum type to hold the result. -A few additonal operations not included in WebAssembly are also +A few additional operations not included in WebAssembly are also specified, and there are some other small differences (highlighted below).