4 ms·
I loved this post. It’s very readable and introduces some interesting concepts related to type safety and some potentially simple use case in the context of acc
by bluejekyll 9y ago
I loved this post. It’s very readable and introduces some interesting concepts related to type safety and some potentially simple use case in the context of access to private data, guaranteed from a type pattern.
As was pointed out in the Reddit conversation about this [1], the parametricity (new word I learned while reading this last night), will be lost with specialization.
Personally I want specialization for all the joy it will bring, and I don’t see this as a huge loss, but I wonder what other people’s thoughts are on this?
[1] https://www.reddit.com/r/rust/comments/80eis2/reasoning_with_types_in_rust/?st=JE7ZUBNM&sh=5df7aace https://www.reddit.com/r/rust/comments/80eis2/reasoning_with...
- matt-noonan 9y agoTo me, parametric polymorphism is much nicer for reasoning about a program locally / modularly. It's kind of like reasoning about a function with linear control flow vs reasoning about a function with lots of nested if/elses. You can do the reasoning once and be done with it. I tried to make a general point along those lines in this blog post, thought I think it deserves more extensive examples. http://storm-country.com/blog/abstract-is-simple http://storm-country.com/blog/abstract-is-simple