GithubHelp home page GithubHelp logo

Comments (4)

apasel422 avatar apasel422 commented on July 28, 2024

I'm working on some map stuff for this, inspired by @gankro's post Replace Most of the Collections API with ranges and iterators.

from collect-rs.

Gankra avatar Gankra commented on July 28, 2024

One issue with my proposal of having a Get/Remove/Insert traits is that the semantics for remove and insert are different for Maps and Sequences. Panic vs Option.

from collect-rs.

apasel422 avatar apasel422 commented on July 28, 2024

See https://github.com/apasel422/eclectic.

This is very much a work in progress, and there are certain bugs with associated types that are preventing me from organizing this exactly the way I want. I opted to separate mutable functionality into separate traits, though there is an argument to be made for combining them.

I will be adding additional constraints for indexing and iteration (all three modes) in the future.

I also need to figure out a solution to the iterator discrepancy between maps like TreeMap and TrieMap (the former yields (&K, &V), while the latter yields (usize, &V)). I have an idea for how to fix this using a Borrow bound on an associated IterKey type that would default to &K once we have default associated types, but the solution currently involves an extra lifetime parameter on Map that ends up propagating to all four map traits. I'll demonstrate this in another branch.

from collect-rs.

apasel422 avatar apasel422 commented on July 28, 2024

rust-lang/rust#20671 is also holding things up.

from collect-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.