3 ms·
Linear types and uniqueness typing are so close together that people often mix them up. Yes, that's basically what I am talking about. For general usage monad
by eru 7y ago
Linear types and uniqueness typing are so close together that people often mix them up. Yes, that's basically what I am talking about.
For general usage monads are much easier to deal with than Clean's "pass around the world" system. (I only used Clean for a bit, but haven't used Miranda, yet.) However, linear types for Haskell have been in the works for some time. See eg https://www.reddit.com/r/haskell/comments/dpr276/what_is_the_status_of_ghc_linear_types/ https://www.reddit.com/r/haskell/comments/dpr276/what_is_the...
(Similarly, GHC now support strict Haskell, too, on a per module basis.)
Uniqueness typing shines when you want to split up your 'real-world' object, so you can eg manipulate individual memory cells or ports etc independently.
Rust goes into unsafe mode for multiple reasons. You could eliminate most of those, if you were willing to take the complexity of dependent types. Ie more or less that means the programmer taking on a greater burden of proving code to be safe to the compiler; instead of relying on Rust's more automatic but conservative system.