[Caml-list] Arrays and private types

2012-03-14 Thread Pietro Abate
hello world. In my application I'm using arrays all over, and lately I've discovered a couple of bugs related to the fact that I was using the index of one array to get the element of another array. Since both indexes are int the compiler could not help me at all. Using private types it seems I

Re: [Caml-list] Arrays and private types

2012-03-14 Thread Gabriel Scherer
Here is a proposal: https://gitorious.org/gasche-snippets/private-array-keys-type/blobs/master/private_array_key_types.ml It works by using a functor to generate fresh private types for keys. Note that the arrays themselves are still polymorphic (no IntArray FloatArray etc.). The user still