Hello, I released 0.18 a few days ago, a small release. There are a few deprecated functions around containers right now, but I'm considering a possibly more breaking change.
The module CCHash (in core) is one of the modules I dislike the most, as I had to write a custom hash function, and the type of hasher: type 'a hash_fun = state -> 'a -> state is pretty annoying to work with in practice. Hashtbl.Make, for instance, requires `val hash : 'a -> int`. I am considering replacing this module with a new one, that would be based on `'a hash_fun = 'a -> int` (only positive ints), and combine hashes using variants of `Hashtbl.seeded_hash`. Something like ``` type 'a hash_fun = 'a -> int val hash : 'a hash_fun (* hashtbl.hash *) val int : int hash_fun val string : string hash_fun (* ... *) val combine : int -> int -> int (* hashtbl.seeded_hash *) val hash_list : 'a hash_fun -> 'a list hash_fun (* relies on combine *) val pair : 'a hash_fun -> 'b hash_fun -> ('a * 'b) hash_fun (* relies on combine *) ``` Opinions on this? Would this break anyone's code except mine? -- Simon Cruanes http://weusepgp.info/ key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3 7D8D 4AC0 1D08 49AA 62B6
signature.asc
Description: PGP signature
_______________________________________________ Containers-users mailing list Containers-users@lists.ocaml.org http://lists.ocaml.org/listinfo/containers-users