> 
>  > What are first class modules ? Can you give a reference (preferably
>  > online) ?
> 
> Modules can be viewed as records. See Luca Cardelli and Peter Wegner:
> "On Understanding Types, Data Abstraction, and Polymorphism". 
> 
> Claus Reinke has a virtual bookshelf devoted to modules at
> 
>   http://www.informatik.uni-kiel.de/~cr/bib/bookshelf/Modules.html
> 
> where this article can be found.

Well, actually I stopped myself from making local copies long time
ago, so the bookshelf is even more virtual now (of course, I keep the
links to online articles I know about). It still does not contain
references for all historically relevant papers on modules, but I'm 
working on that... ;-) 

`First class modules' are just that: modules that are also first
class data objects of the programming language (e.g., records
containing functions). In a functional language, it is standard to
have first class programs, so why shouldn't program building blocks
have the same status? Ideally, the whole extra language complexity
introduced by the separate module language (the import/export stuff)
could be replaced by well-known programming techniques of the base
language, gaining a simpler, yet more expressive language:

  - control over import/export? use parameters and local declarations
  - parameterized modules? simple, just use lambda-abstraction
  - composing programs? of course, use modules as parameters/results
    of functions, the primitive operations on modules are similar to 
    those on (extensible) records
  - ...

It would really be nice to have first class modules, even in a less
idealized form, in modern functional languages, including Haskell -
there seem to be no counter arguments of the style "don't want that",
but quite a few of the kind "can't do that", especially if a static
type inference system is involved or if you insist on having type
declarations inside modules instead of typing the module itself.

Apart from the Cardelli/Wegner paper mentioned above, the bookshelf
contains some other references to work on first class modules,
including my own (which, not bounded by the restrictions of a static
type system, takes an even more radical approach to the topic).
However, since this isn't comp.lang.functional, the work of Mark
Jones is probably the most interesting here, as he tries to close the
gap between available static type inference systems and the high
demands of the `first class modules'-idea. His latest two papers
aren't yet on my shelf (in the reading queue), cf. his home page for
those:

  http://www.cs.nott.ac.uk/Department/Staff/mpj/

Finally, I have a question to the Haskell committee: what are your
plans about this?

Claus


PS. Please send me any references on first class modules that I 
    haven't found yet. Thanks.

-- 
Claus Reinke                                University of Kiel
email: [EMAIL PROTECTED]            Department of Computer Science
http://www.informatik.uni-kiel.de/~cr/      Preusserstr. 1-9,   24105 Kiel



Reply via email to