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
any types in signatures of functor arguments
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-10-25 (02:22)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] any types in signatures of functor arguments
From: Brian Hurt <>
> I think the problem is that `A holds something, but you're not giving 
> Ocaml any idea of what.  For example, the following compiles:
> module F(X:sig type 'a t = [`A of 'a ] val f : 'a t -> int end) =
>    struct
>      let f = function `A x as a -> X.f a | `B -> 0
>    end

I see...

So it seems that I cannot avoid modifying modules to which F is applied.
Actually, I already written several modules, say M and N, in separate files.
Later, I defined the functor F so as to apply it to the modules M and N.
I thought that it would be nice if I can avoid modifying 
the implementations and interface files of M and N,
since it will affect other parts of my program.

Thanks for the reply.

Keiko Nakata