Version française
Home     About     Download     Resources     Contact us    
Browse thread
Nested modules: signature restriction possible?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: szegedy@t...
Subject: Re: [Caml-list] Nested modules: signature restriction possible?
I am writing a code with almost the same functionality and
I was also bugged by the same problem and posed the same
question in the functional mailing list.

Julien Signoles was kind enough to answer:

> I also encounter this annoying situation. In general, I solve it in the
> following way:
> 
> module type A = sig type t val f: t -> t end
> module type B = sig include A val g: t -> t end
> module type C' = sig type c val h: c -> c end
> module type C = sig include A include C' with type c = t end
> module type D = sig include B include C' with type c = t end
> 
> Sadly, this solution uses some additional types and with-type constraints
> but IMHO it is the best when your signatures are big.
> 
> Hope this helps,

I've got a similar algebra package as yours, but my design is quite
pragmatic: I have only programmed those parts I really needed.
I send my version in a separate mail.

It would be fun to cooperate, if you would like to.

(What I currently think about is the GCD computation over multivariate 
polynomial fields (it is needed for the functions field), and it
is hard to get it efficient. After I solved it, I will want to programm
Groebner base manipluation.)

Best regards, Christian