Why is Clone required for basically everything?
I find it surprising that things like impl<A> Debug for Vector<A> require A: Clone. I have looked at the implementation and I'm pretty sure it should be possible to loosen Clone trait bounds in many places. Would PRs for that be welcome?
just read the doc https://docs.rs/im/latest/im/#when-does-cloning-happen . TLDR Clone of small-ish values is faster than alternatives and if you have big values just use Rc<...> or Arc<...> where it clones just the pointer
It cannot be changed without complete redesign. It has optimized like this for a reason that there are small opportunistic arrays that get cloned when needed
It can be changed. imbl, which is a maintained fork of im, implements some of the required changes (I recently contributed some myself). Note that I am not asking to make Vector<T> a properly usable type that values can be pushed to / that can be cloned or whatever. I just want to be able to drive Debug for a generic type that holds Vector<T> (which I have done successfully, since switching to imbl).