Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] My wishlist: DRY modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-10-14 (00:21)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] My wishlist: DRY modules
On Thu, 2004-10-14 at 09:09, brogoff wrote:
> On Wed, 13 Oct 2004, Brian Hurt wrote:
> >
> > I'm doing some work with modules, and I'm learning some of their
> > annoyances.  Number one is having to repeat module type definitions.  For
> > example, say you have a file foo.  In foo.mli, you have:
> It's annoying, but in the case you describe, just put the signatures
> in their own separate file ( or whatever), then you refer to them as
> Sigs.T, Sigs.S, etc.,  and  you don't need to  repeat them, or change them in
> more than one place as you develop. If you do it that way, the annoyance
> becomes pretty small.

But can you do that with functor instances?

When I write something like:

module IntSet = Set.Make(struct type t = int end)

but type of IntSet is be spelled out long hand
in the mli file. This is far worse than merely
reflecting the interface of a module you wrote
by hand -- it also breaks with upgrades to
the library :(

Of course I can use ocamlc -i, but then I can't
apply any constraints. I'd like to be able
to instantiate a functor type too. Can this be done?

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: