Version franēaise
Home     About     Download     Resources     Contact us    
Browse thread
Problem with module inclusion
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fabrice Marchant <fabricemarchant@f...>
Subject: Re: [Caml-list] Problem with module inclusion
On Thu, 05 Jun 2008 09:36:09 +0200
Jean-Christophe Filliātre <Jean-Christophe.Filliatre@lri.fr> wrote:

> You need
> 
> - either to export to_list in signature of XMap above as
> 
> 	val to_list : 'a t -> (X.t * 'a) list
> 
>   and then you'll be able to write StringCounters.XMap.to_list in your
>  example
> 
> - or to re-export it in module Counters, as
> 
> 	let to_list = XMap.to_list
> 
>   and to declare it in signature of module Counters, as
> 
> 	val to_list : t -> (X.t * int) list
> 
>   and then to use it as StringCounters.to_list in your example.
> 
> Hope this helps,
   It perfectly does ! Thanks a lot.

  Among the 2 ways you explained, I prefer the former because we haven't to worry over what is the enclosing module. But maybe specifying 'int' type in the later would cause a speeder code ?

Regards,

Fabrice

http://fabrice.marchant.free.fr/siteOCaml/OCaml.html