Skip to content

Commit

Permalink
fix: some typos found using typos cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Jul 1, 2024
1 parent f158384 commit a8fa01d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion hugr-core/src/extension/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/hugr/views/sibling_subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<Node>>,
hugr: &impl HugrView,
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/proptest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions hugr-core/src/types/type_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TypeParam>) -> Self {
Self::List {
param: Box::new(elem.into()),
Expand Down Expand Up @@ -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()
}
Expand Down Expand Up @@ -484,15 +484,15 @@ mod test {
#[test]
fn type_arg_fits_param() {
let rowvar = Type::new_row_var_use;
fn check(arg: impl Into<TypeArg>, parm: &TypeParam) -> Result<(), TypeArgError> {
check_type_arg(&arg.into(), parm)
fn check(arg: impl Into<TypeArg>, param: &TypeParam) -> Result<(), TypeArgError> {
check_type_arg(&arg.into(), param)
}
fn check_seq<T: Clone + Into<TypeArg>>(
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();
Expand Down
2 changes: 1 addition & 1 deletion hugr-passes/src/const_fold/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions specification/hugr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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", [])])
```
Expand Down Expand Up @@ -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).

Expand Down

0 comments on commit a8fa01d

Please sign in to comment.