Git Product home page Git Product logo

lru's Issues

Doc comment possibly incorrect

Adding a bindings k -> v to kvs means List.remove_assoc k kvs @ [(k, v)]

I think the (k,v) that has been added should come at the front? At least the following doc has:

Promoting a binding k -> v means removing, and then re-adding it.

So, presumably re-adding moves the binding to the front?

Trim after adding

Calling trim after add-ing an element, instead of requiring the user to call trim makes sense to me.

Was there a reason trim wasn't part of add? If not, I can try adding it.

make a first release in opam?

You know the rule, if it's not in opam it doesn't exist :-)

and it's just a topkg tag && topkg bistro away anyway.

Query about interface (possible misunderstanding of semantics)

Great library!

If I have an entry k->v, and I want to change it to k->v', is there a way to do this without altering the "least recently used" information? (Does this question make sense?)

I think I want something like the "add" function, but where the k->v' binding is not necessarily the "most recently used".

Peek support

I would like to be able to access an element of a mutable LRU without promoting it.
Something like LRU.M.S.peek key lru, returning a value option without changing the existing order.

A related need I have is to be notified of dropped values, although I don't know what the best API would be for that.

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.