2 ms·
Reminds me of how Haskell solved this problem [1] [2] Haskell's solution is elegant, powerful, and straightforward. Roles make it all work without programmer t
by whateveracct 2y ago
Reminds me of how Haskell solved this problem [1] [2]
Haskell's solution is elegant, powerful, and straightforward. Roles make it all work without programmer trade-off. And nowadays, Coercible has been built upon to be a metaprogramming tool (-XDerivingVia).
[1] https://hackage.haskell.org/package/base-4.20.0.1/docs/Data-Coerce.html https://hackage.haskell.org/package/base-4.20.0.1/docs/Data-...
[2] https://www.seas.upenn.edu/~sweirich/papers/coercible-JFP.pdf https://www.seas.upenn.edu/~sweirich/papers/coercible-JFP.pd...
- amelius 2y agoI think here the issue is that the conversion happens without copying anything, and this is guaranteed.
- whateveracct 2y agoThat's what the paper is about: > Safe Zero-cost Coercions for Haskell