Dear Serge,If I understand correctly what you are asking, then you can make it work by wrapping the definition of topicf in an existential:module R = structtype topicf = TF : ((module I with type message = 'a) -> 'a -> 'a) -> topicfand topic = { func: topicf; name: string }...endthen, given test, you can create an R.topic by doing{ R.func = TF test; name = "test" }Best wishes,NicolásOn Thu, Nov 23, 2017 at 1:52 PM, Serge Sivkov <ssp.mryau@gmail.com> wrote:...Hello,is there way to define module with similar interface:
module R = struct
type topicf = (module F : I) -> F.message -> F.message
and topic = { func: topicf; name: string }endit is possible in case I want to define function with similar signature I can declare used types by:let test (type message') (module M : I with type message = message') (v: message') : message' = ...But how should I create such type in module?WBR, ssp