Skip to content

Instantly share code, notes, and snippets.

@hcarty
Last active December 14, 2015 09:39
Show Gist options
  • Save hcarty/5066345 to your computer and use it in GitHub Desktop.
Save hcarty/5066345 to your computer and use it in GitHub Desktop.
Generic indexables
See hcarty/indexmap for the latest
@c-cube
Copy link

c-cube commented Mar 1, 2013

I think the index type should have a second (optional) argument, say, "mem : 'index -> bool" to check whether a key belongs to the map. It's cleaner and possibly more efficient than "try ignore (index.get foo); true with Not_found -> false".

Apart from that, the abstraction is very nice!

@hcarty
Copy link
Author

hcarty commented Mar 4, 2013

Thanks! I've cleaned things up a bit, added mem in a similar way to how you suggested, and created a proper repository. See https://github.com/hcarty/indexmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment