diff --git a/meetings/2021.02.09-lazy-norm.md b/meetings/2021.02.09-lazy-norm.md index 8e3bd32..180d243 100644 --- a/meetings/2021.02.09-lazy-norm.md +++ b/meetings/2021.02.09-lazy-norm.md @@ -44,7 +44,7 @@ Two solutions: * but that implies a `T: Trait`, which would bring in `U` * will pull in too many parameters, still prevent some programs from compiling (e.g., `fn foo() -> [u8; size_of::()] where T: PartialEq` will pull in `U` but it's not really needed) * back-compat when later improving the filtering? probably fine - * additional weirdness` + * additional weirdness ```rust pub trait Trait { const ASSOC_CONST: usize = 0; diff --git a/vision/status_quo/nalgebra.md b/vision/status_quo/nalgebra.md index 6340bc3..7ad3dc9 100644 --- a/vision/status_quo/nalgebra.md +++ b/vision/status_quo/nalgebra.md @@ -2,11 +2,11 @@ *a huge thanks to [Andreas Borgen Longva](https://github.com/Andlon) and [Sébastien Crozet](https://github.com/sebcrozet) for the help with figuring this out* -[nalgebra](https://nalgebra.org/) is a linear algebra library. At the core of that library is a type `struct Matrix` where `T` is the components scalar type, `R` and `C` represents the number of rows and columns and `S` represents the type of the buffer containing the data. +[nalgebra](https://nalgebra.org/) is a linear algebra library. At the core of that library is a type `struct Matrix` where `T` is the components' scalar type, `R` and `C` represent the number of rows and columns and `S` represents the type of the buffer containing the data. Relevant for const generics are the parameters `R` and `C`. These are instantiated using one of the following types: ```rust -// For matrices of know size. +// For matrices of known size. pub struct Const; // For matrices with a size only known at runtime. pub struct Dynamic { value: usize } @@ -15,7 +15,7 @@ pub struct Dynamic { value: usize } The authors of nalgebra then introduce a type alias ```rust pub struct ArrayStorage(pub [[T; R]; C]); -/// A matrix of statically know size. +/// A matrix of statically known size. pub type SMatrix = Matrix, Const, ArrayStorage>; ``` @@ -62,7 +62,7 @@ where } ``` -As these bounds infect the public API, they are also a large backwards compatability concern. +As these bounds infect the public API, they are also a large backwards compatibility concern. ### `ToTypenum` is only implemented up to fixed size @@ -82,7 +82,7 @@ fn foo() { let matrix: SMatrix = SMatrix::zeros(); } ``` -While this can be avoided by going to back to `typenum` and using associated types, this adds a lot of unnecessary bounds and inpacts all of the code dealing with it. +While this can be avoided by going back to `typenum` and using associated types, this adds a lot of unnecessary bounds and impacts all of the code dealing with it. ### Generic parameters aren't exhaustive @@ -141,7 +141,7 @@ error[E0207]: the const parameter `R` is not constrained by the impl trait, self ### Merge partial impls to be exhaustive -By adding one trait impl impl for `Dim::Dynamic` and one for `Dim::Const(N)`, it should be enough to consider that trait to be implemented for all `Dim`. +By adding one trait impl for `Dim::Dynamic` and one for `Dim::Const(N)`, it should be enough to consider that trait to be implemented for all `Dim`. Ideally, the compiler should figure this out by itself, or it can be emulated using specialization by manually adding an impl for all `Dim` which always gets overridden.