@graydon Did you ever have an idea of how destructors would work in a Rust organized using ML functors rather than type classes? Would you just call destructors manually?

@zwarich @graydon Drop in Rust piggybacks on the same syntax, but isn't really a type class -- you don't go around writing `T: Drop`, it's just assumed. You could do it the same way in an ML-like with some dedicated syntax for defining the destructor.

(If Rust *were* linearly typed then `T: Drop` would suddenly make a lot of sense. And I agree with Graydon that ML functors and linear types would go well together, basically choosing "do it manually" in both cases... but you don't *have* to.)

Sign in to participate in the conversation
Mastodon

a Schelling point for those who seek one