We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clone
if a container type always mutable and element type is Immutable, we just invoke copy method to impl Clone trait.
copy
if we hava Functor trait and Copy trait, we can simply get a default implementation
impl[T : Clone] Clone for Array[T] with mutability() { Mutable } impl[T : Clone] Clone for Array[T] with clone(self) { match T::mutability() { Mutable => self.map(T::clone) Immutable => self.copy_array() } }
The text was updated successfully, but these errors were encountered:
I also think that if we had Clone traits, then Copy traits would be necessary, similar to Rust, but is Functor traits really necessary?
cc @peter-jerry-ye
Sorry, something went wrong.
I think the proposal is simply unnecessary.
No branches or pull requests
Clone
trait for builtin #1425if a container type always mutable and element type is Immutable, we just invoke
copy
method to impl Clone trait.if we hava Functor trait and Copy trait, we can simply get a default implementation
The text was updated successfully, but these errors were encountered: