caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] recursive module type
@ 2013-05-04 12:23 Michaël Lienhardt
  2013-05-04 12:39 ` Gabriel Scherer
  2013-05-04 12:47 ` Jacques Garrigue
  0 siblings, 2 replies; 5+ messages in thread
From: Michaël Lienhardt @ 2013-05-04 12:23 UTC (permalink / raw)
  To: caml-list

Hello,

I would like to define some recursive module type in caml, like
module type S = sig
  ...
  module Toto(M : S) : sig
   ...
  end
end

More precisely, I'd like to extend the Set module available in the ocaml distribution with a function that convert a set into another set.
Intuitively, I came up with the following signature S, which is not accepted by ocaml (Error: Unbound module type S):

   module type S = sig

     include Set.S

     module Convert : functor(SetTarget : S) -> sig
       val convert : (elt -> SetTarget.elt) -> t -> SetTarget.t
     end
   end

Is there a way to define such a module type in ocaml, and if not, is there a theoretical reason for this not being possible?

Thanks,
Michael Lienhardt

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

end of thread, other threads:[~2013-05-13 12:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-04 12:23 [Caml-list] recursive module type Michaël Lienhardt
2013-05-04 12:39 ` Gabriel Scherer
2013-05-04 12:47 ` Jacques Garrigue
2013-05-04 16:01   ` Michaël Lienhardt
2013-05-13 12:17   ` Alain Frisch

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).