Hey,
I have a small problem with the return type of functions while using resi files.
Here is a small example which works fine:
// Test.res
type t<'a>
let map: (t<'o1>, 'o1 => 'r) => t<'r> = %raw(...)
// Demo.res
let mapped = Test.map(counter, x => x * 2) // => Test.t<int>
Since I have a lot of map functions with more params (map2, map3, …), I wanted to remove the clutter by declare these functions in an interface file:
// Test.resi
type t<'a>
let map: (t<'o1>, 'o1 => 'r) => t<'r>
// Test.res
type t<'a>
let map = %raw(...)
Unfortunately now the return type of the mapped value is 'a
instead of Test.t<int>
// Demo.res
let mapped = Test.map(counter, x => x * 2) // => 'a
What am I doing wrong?
Cheers
Daniel