Re:Comparing the Same Project in Rust, Haskell, C++, Python,...
by grumdan on Sunday June 16, 2019 @06:13AM
(#20194787)
This particular example can be encoded into the Haskell type system though. For example, there's a tensor library where all operations are (according to the description) checked for the correct dimensions by the type system. It seems to require a lot of type-level magic though, and that may disqualify it for "cleanly".
http://hackage.haskell.org/package/easytensor