Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: circular types?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <tews@t...>
Subject: Re: circular types?

Tom Hirschowitz writes:
   From: Tom Hirschowitz <>
   Date: Tue, 24 Oct 2000 10:48:06 +0200
   Subject: Re: circular types?
   [some of the pseudo code deleted]

   ========== file
   ? type formula
   type expression =
     | Abstraction of (string * types) list * expression
     | Formula of formula
   ========== file
   ? type expression
   type formula = 
     | Forall of (string * types) list * formula
     | Expression of expression
   ========== file
   module MyTypes = Types + Expression + Formula;;
   Is it enough?
I think yes, just a two question to make sure I get it right:

- If I want to program a function typecheck (which recursively
walks down formulas, expressions, and types) I separate it into
typecheck_formula, typecheck_expression, etc and put these
functions into the respective files. Will there be lightweight
syntax for the forward declaration of typecheck_expression in
file similar to what you used for the types above? 

- Assume another module that uses typecheck_formula, does it have
to "open" Formula or Next? 

- How about link order? The mixin module is linked after all
modules it mixes and all modules that use something of file
formula or expression have to be linked after the mixing module?

- (Impatiently) In which ocaml release can I expect the mixing