2011/3/13 Marijn Haverbeke <[email protected]> > In Haskell, and this is probably > worth following, only the module that defines the type, or the module > that defines the typeclass, can declare an instance for a > type/typeclass combo.
I don't think this is true. Anyone who can see both the type and the type class visible can declare an instance. This is very convenient and something that should be retained in a potential Rust version, IMO. It's very nice to be able to supply instances for existing types for your new type class, for example, but not something you'd normally want to put in the main module because it's really an optional extra. Sebastian -- Sebastian Sylvan
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
