4 ms·
You can do that without HKT, using FromIterator (which is also used by the widely used iterator method "collect"). Here is an implementation: https://play.rust
by paavohtl 7y ago
You can do that without HKT, using FromIterator (which is also used by the widely used iterator method "collect").
Here is an implementation: https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=9d7ce08d47215f71199557c799de1cff https://play.rust-lang.org/?version=stable&mode=release&edit...
Fill is also possible, using the same trait and iterators.
- logicchains 7y agoI stand corrected. Could the same technique also be used to have a struct parameterised by C and T that had a C as a member?
- leshow 7y agoYou can't partially apply type parameters in rust, that is HKT. But traits & associated types in traits get you pretty far.