Yeah, I got confused -- I thought that you could have
recursive modules, as long as there were no recursive
definitions. It's all taken care of, thanks to the
advice I received on this group.
Thankyou very much for the help 
cheers,
Rob
--- Jonathan Roewen < jonathan.roewen%40gmail.com">jonathan.roewen
gmail.com> wrote:
> 1) Individual modules aren't recursive, so A can't
> reference B, which references A
> 2) anything you declare in an .mli file must be
> present in the associated .ml file (if there is one)
>
> So in your case, History.take_snapshot depends on
> the type in Model,
> and Model.snapshot depends on History.take_snapshot.
>
> Moving the type declaration for Model into a
> separate module which
> only defines types, for instance, will break the
> recursive
> dependencies.
>
> Jonathan
>
> On 11/17/06, doeweyahewe < doeweyahewe%40yahoo.com.sg">doeweyahewe
yahoo.com.sg>
> wrote:
> > Hi there,
> >
> > I'm using OCaml to do some modelling work, and
> I've come across a
> > problem. My model is implemented in model.ml(i)
> and I have some
> > analysis code in query.ml(i). Here's the basic
> problem:
> >
> > Model.mli
> > =========
> > type model = ...
> >
> > History.mli
> > ===========
> > type snapshot = ...
> >
> > val take_snapshot : Model.model -> snapshot
> >
> > Model.ml
> > ========
> > let snapshot = take_snapshot some_model in ...
> >
> > Compiler Error
> > ==============
> > "This expression [some_model] has type model but
> is here used with
> > type Model.model"
> >
> > For some reason, the OCaml compiler doesn't
> recognise that
> > Model.model is exactly the same type as model,
> inside the Model
> > module. How can I get around this behaviour?
> >
> > Many thanks in advance for your time and any
> advice,
> > Rob Moss
> >
> >
> >
> >
> > Archives up to November 11, 2006 are also
> downloadable at
>
http://www.connettivo.net/cntprojects/ocaml_beginners/
> > The archives of the very official ocaml list (the
> seniors' one) can be found at http://caml.inria.fr
> > Attachments are banned and you're asked to be
> polite, avoid flames etc.
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
>
> Archives up to November 11, 2006 are also
> downloadable at
>
http://www.connettivo.net/cntprojects/ocaml_beginners/
> The archives of the very official ocaml list (the
> seniors' one) can be found at http://caml.inria.fr
> Attachments are banned and you're asked to be
> polite, avoid flames etc.
> Yahoo! Groups Links
>
> (Yahoo! ID required)
>
> mailto: ocaml_beginners-fullfeatured%40yahoogroups.com">ocaml_beginners-fullfeatured
yahoogroups.com
>
>
>
>
____________________________________________________
Yahoo! Singapore Answers
Real people. Real questions. Real answers. Share what you know at http://answers.yahoo.com.sg
.