I’m trying to write some generic code using module functors. A simplified version can be found on the Playground.
I try to use a type from a module functor parameter, but it seems I can only see the type declaration from the module type (Locales.t
), and not the type I filled in ([#en_GB | #nl_NL]
).
[E] Line 32, column 41:
Signature mismatch:
...
Values do not match:
let translate: ([< #en_GB | #nl_NL], entry) => string
is not included in
let translate: (Locales.t, entry) => string
File "playground.res", line 19, characters 3-46: Expected declaration
File "playground.res", line 35, characters 7-16: Actual declaration
Could someone explain why that is? Is there a way around this?