I found something which I don't really understand while working on an ocaml project.
Suppose I'm using both the Array and List modules of OCaml standard library. They both implement the function length but have different types.
In the List module, this is its type:
length: a' list -> int
And in the Array module, it has the type:
length: a' array -> int
But then I wanted you use both modules in the same module I was implementing, via the open keyword:
open List
open Array
When I tried to use the length function on a list, I had a type error during compilation.
Since OCaml is a strong statically typed language, I'm wondering why the compiler didn't know I wanted the length function of the list module since I declared I was using both.
fun s -> length sin this context then? - Pascal Cuoqa' array -> int- Joseph Elcid