caml-list - the Caml user's mailing list
 help / Atom feed
From: Miguel Ambrona <miguel.ambrona@imdea.org>
To: caml-list@inria.fr
Subject: [Caml-list] Function that outputs a functor
Date: Tue, 30 Apr 2019 15:10:16 +0200
Message-ID: <f5de4440-983b-a51f-0093-c292b7b674fa@imdea.org> (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!

Best,

Miguel




             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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=f5de4440-983b-a51f-0093-c292b7b674fa@imdea.org \
    --to=miguel.ambrona@imdea.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox