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] Multiparameter functors?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-22 (23:04)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] Multiparameter functors?
On Sun, Dec 21, 2003 at 07:30:27PM -0500, Brian Hurt wrote:
> Is it possible to do multi-parameter functors?  What I want to be able to 
> so is something like:
> module Make(Key: Map.OrderedType, Pri: Map.OrderedType) = struct
> 	type key = Key.t;;
> 	type pri = Pri.t;;
> 	...
> end;;
> Am I being stupid and just missing something obvious,

Is there anything obvious about functors? ;-)

I've found the following syntax to work:

  module Make =
    functor (Key:Map.OrderedType) -> functor (Pri:Map.OrderedType) ->

... though I'm not qualified to comment on the merits of doing or not
doing this.

Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through           its fields;   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                            --Lao Tzu (Peter Merel, trans.)

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