caml-list - the Caml user's mailing list
 help / Atom feed
From: Miguel Ambrona <>
Subject: [Caml-list] Function that outputs a functor
Date: Tue, 30 Apr 2019 15:10:16 +0200
Message-ID: <> (raw)

Dear caml-hackers,

Is there a way of writing a function that returns a functor?

For example, the following function takes an integer and returns a module:

``let make (n : int) = (module struct blablabla end : MyModule)''

Can I do the same with a functor as output instead of a module? Of
course, the implementation may use the integer "n".

Thanks a lot!



             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 13:11 Miguel Ambrona [this message]
2019-04-30 13:28 ` Nicolás Ojeda Bär

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox