caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual
@ 2017-12-22  9:13 Evgeny Roubinchtein
  2017-12-27  7:56 ` [Caml-list] A question about "8.9 First-class modules -> Advanced Oleg
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Evgeny Roubinchtein @ 2017-12-22  9:13 UTC (permalink / raw)
  To: OCaml Mailing List

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

Dear OCaml users and developers,

I find the "Advanced examples" sub-section of the "First-class modules"
section in the reference manual (
http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec244) to be a bit
short on motivation.

I appreciate that it may be, "possible to parametrize some code over the
implementation of a module without using a functor", but I am having
trouble imagining why one would want to do such a thing.  Also, the
"without using a functor" part comes across (to me) as a bit hollow, given
that the example provided _does_ in fact use [Set.Make] functor: it just
hides the invocation of that functor inside the definition of the
[make_set] function, so it reads (to me) like just a round-about way to
invoke the [Set.Make] functor.

Also, was a description of first-class modules in OCaml published in either
a paper or a thesis, or perhaps a journal article?

Thank you in advance!

-- 
Best,
Evgeny ("Zhenya")

[-- Attachment #2: Type: text/html, Size: 1227 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] A question about "8.9 First-class modules -> Advanced
  2017-12-22  9:13 [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Evgeny Roubinchtein
@ 2017-12-27  7:56 ` Oleg
  2018-01-03 10:22 ` [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Nicolás Ojeda Bär
  2018-01-04 16:50 ` Hao Wu
  2 siblings, 0 replies; 6+ messages in thread
From: Oleg @ 2017-12-27  7:56 UTC (permalink / raw)
  To: zhenya1007; +Cc: caml-list


> I appreciate that it may be, "possible to parametrize some code over the
> implementation of a module without using a functor", but I am having
> trouble imagining why one would want to do such a thing.  

Here is an example why one may want to do such thing
        http://okmij.org/ftp/tagless-final/nondet-effect.html#no-functor

In fact, tagless-final approach lends itself very well to first-class
modules.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual
  2017-12-22  9:13 [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Evgeny Roubinchtein
  2017-12-27  7:56 ` [Caml-list] A question about "8.9 First-class modules -> Advanced Oleg
@ 2018-01-03 10:22 ` Nicolás Ojeda Bär
  2018-01-03 10:47   ` Xavier Leroy
  2018-01-04 16:50 ` Hao Wu
  2 siblings, 1 reply; 6+ messages in thread
From: Nicolás Ojeda Bär @ 2018-01-03 10:22 UTC (permalink / raw)
  To: Evgeny Roubinchtein; +Cc: OCaml Mailing List

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

Dear Evgeny,

I am not sure how up-to-date they are, but you may be interested in the
following notes by Xavier:

  https://caml.inria.fr/pub/papers/xleroy-recursive_modules-03.pdf

Cheers,
Nicolás

On Fri, Dec 22, 2017 at 10:13 AM, Evgeny Roubinchtein <zhenya1007@gmail.com>
wrote:

> Dear OCaml users and developers,
>
> I find the "Advanced examples" sub-section of the "First-class modules"
> section in the reference manual (http://caml.inria.fr/pub/
> docs/manual-ocaml/extn.html#sec244) to be a bit short on motivation.
>
> I appreciate that it may be, "possible to parametrize some code over the
> implementation of a module without using a functor", but I am having
> trouble imagining why one would want to do such a thing.  Also, the
> "without using a functor" part comes across (to me) as a bit hollow, given
> that the example provided _does_ in fact use [Set.Make] functor: it just
> hides the invocation of that functor inside the definition of the
> [make_set] function, so it reads (to me) like just a round-about way to
> invoke the [Set.Make] functor.
>
> Also, was a description of first-class modules in OCaml published in
> either a paper or a thesis, or perhaps a journal article?
>
> Thank you in advance!
>
> --
> Best,
> Evgeny ("Zhenya")
>

[-- Attachment #2: Type: text/html, Size: 2196 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual
  2018-01-03 10:22 ` [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Nicolás Ojeda Bär
@ 2018-01-03 10:47   ` Xavier Leroy
  2018-01-03 14:43     ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 6+ messages in thread
From: Xavier Leroy @ 2018-01-03 10:47 UTC (permalink / raw)
  To: caml-list

On 01/03/2018 11:22 AM, Nicolás Ojeda Bär wrote:
> I am not sure how up-to-date they are, but you may be interested in the following notes by Xavier:
> 
>   https://caml.inria.fr/pub/papers/xleroy-recursive_modules-03.pdf

Those notes are about recursive modules, but the original poster was asking for material about first-class modules.  The canonical reference is:

First-class modules and composable signatures in Objective Caml 3.12
    Alain Frisch and Jacques Garrigue. ML Workshop 2010, Baltimore, MD.

Abstract: https://www.math.nagoya-u.ac.jp/~garrigue/papers/ml2010.pdf
Slides: https://www.math.nagoya-u.ac.jp/~garrigue/papers/ml2010-show.pdf

Hope this helps,

- Xavier Leroy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual
  2018-01-03 10:47   ` Xavier Leroy
@ 2018-01-03 14:43     ` Nicolás Ojeda Bär
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolás Ojeda Bär @ 2018-01-03 14:43 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: OCaml Mailing List

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

Oops, that's right! Sorry for the misunderstanding.

Best wishes,
Nicolás

On Wed, Jan 3, 2018 at 11:47 AM, Xavier Leroy <Xavier.Leroy@inria.fr> wrote:

> On 01/03/2018 11:22 AM, Nicolás Ojeda Bär wrote:
> > I am not sure how up-to-date they are, but you may be interested in the
> following notes by Xavier:
> >
> >   https://caml.inria.fr/pub/papers/xleroy-recursive_modules-03.pdf
>
> Those notes are about recursive modules, but the original poster was
> asking for material about first-class modules.  The canonical reference is:
>
> First-class modules and composable signatures in Objective Caml 3.12
>     Alain Frisch and Jacques Garrigue. ML Workshop 2010, Baltimore, MD.
>
> Abstract: https://www.math.nagoya-u.ac.jp/~garrigue/papers/ml2010.pdf
> Slides: https://www.math.nagoya-u.ac.jp/~garrigue/papers/ml2010-show.pdf
>
> Hope this helps,
>
> - Xavier Leroy
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 2242 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual
  2017-12-22  9:13 [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Evgeny Roubinchtein
  2017-12-27  7:56 ` [Caml-list] A question about "8.9 First-class modules -> Advanced Oleg
  2018-01-03 10:22 ` [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Nicolás Ojeda Bär
@ 2018-01-04 16:50 ` Hao Wu
  2 siblings, 0 replies; 6+ messages in thread
From: Hao Wu @ 2018-01-04 16:50 UTC (permalink / raw)
  To: Evgeny Roubinchtein; +Cc: OCaml Mailing List

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

RWO has a chapter if you have not read it.

https://realworldocaml.org/v1/en/html/first-class-modules.html

On Fri, Dec 22, 2017 at 1:13 AM, Evgeny Roubinchtein <zhenya1007@gmail.com>
wrote:

> Dear OCaml users and developers,
>
> I find the "Advanced examples" sub-section of the "First-class modules"
> section in the reference manual (http://caml.inria.fr/pub/
> docs/manual-ocaml/extn.html#sec244) to be a bit short on motivation.
>
> I appreciate that it may be, "possible to parametrize some code over the
> implementation of a module without using a functor", but I am having
> trouble imagining why one would want to do such a thing.  Also, the
> "without using a functor" part comes across (to me) as a bit hollow, given
> that the example provided _does_ in fact use [Set.Make] functor: it just
> hides the invocation of that functor inside the definition of the
> [make_set] function, so it reads (to me) like just a round-about way to
> invoke the [Set.Make] functor.
>
> Also, was a description of first-class modules in OCaml published in
> either a paper or a thesis, or perhaps a journal article?
>
> Thank you in advance!
>
> --
> Best,
> Evgeny ("Zhenya")
>

[-- Attachment #2: Type: text/html, Size: 2018 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-04 16:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-22  9:13 [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Evgeny Roubinchtein
2017-12-27  7:56 ` [Caml-list] A question about "8.9 First-class modules -> Advanced Oleg
2018-01-03 10:22 ` [Caml-list] A question about "8.9 First-class modules -> Advanced examples" section of the reference manual Nicolás Ojeda Bär
2018-01-03 10:47   ` Xavier Leroy
2018-01-03 14:43     ` Nicolás Ojeda Bär
2018-01-04 16:50 ` Hao Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).