List Info

Thread: "ocaml_beginners"::[] Trouble with passing types between modules




"ocaml_beginners"::[] Trouble with passing types between modules
user name
2006-11-17 03:12:06

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

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )