Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] any types in signatures of functor arguments
From: Brian Hurt <bhurt@spnz.org>
> 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.

Regards,
Keiko Nakata