6 ms·
If that is what I think it is, see https://docs.rs/indexing https://docs.rs/indexing for something similar, crafted from invariance over higher-ranked lifetimes
by eddyb 10y ago
If that is what I think it is, see https://docs.rs/indexing https://docs.rs/indexing for something similar, crafted from invariance over higher-ranked lifetimes, instead of types.
I don't think Rust can ever replicate the Haskell implementation identically (if we had HRTB over types), as type parametrism is gone (see: specialization RFC).
However, lifetime parametrism serves a similar role in Rust, and lifetimes are closer to a concept of "instance" than types.