Here is a simplified example of a Functor setup in my codebase. The module Number
which is a module of type Item
, is passed as an argument to functor Make
. The resulting types SpecificItem.t
and Number.t
are (to my eyes, but not to the compiler) the same. Hence the compiler calls out the type mismatch on this line:
let integers = values->Array.map(Number.toInt)
This (values) has type: array<SpecificItem.t>
Somewhere wanted: 'a => 'b
But how do I reconcile the types array<SpecificItem.t>
with array<Number.t>
for this line of code?