Last active
December 14, 2015 09:39
-
-
Save hcarty/5066345 to your computer and use it in GitHub Desktop.
Generic indexables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See hcarty/indexmap for the latest |
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
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!