5 ms·
> you can multiply n by k, k by m matrices to get an n by m matrix, but anything else is a type error. This is exactly how Repa works, it uses a Peano encoding
by freyrs3 12y ago
> you can multiply n by k, k by m matrices to get an n by m matrix, but anything else is a type error.
This is exactly how Repa works, it uses a Peano encoding of the extent of dimensions to make invalid array operations inexpressible.
- seanmcdirmid 12y agoOk. This isn't obvious at all by looking at the documentation, also since extent doesn't seem to appear in the type signature of a matrix instance.
- deleted 12y ago[deleted]
- seanmcdirmid 12y agoAh, this is exactly the approach I took in C# (though with a small range of branded types to stand in for numbers). Thanks for clearing this up!