Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Records typing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Records typing
Follow-up to myself:

> # module M' = struct type t = float type r = {f : t} end;;
> module M' : sig type t = float and r = { f : t; }  end

There is actually a bug: depending on what is the definition, it is
either in the interpretation of type declaration or in the
pretty-printer.

# module M : sig type t = float and r = { f : t; } end = M';;
Signature mismatch:
Modules do not match: [...]

That is, the signature printed is not a valid interface for the above
module.  And the fix to the printer would not be easy.
But the printer is known to have a number of such bugs.

And if we were to fix instead the interpretation of type definitions,
using unboxed represention even for mutually recursive definitions,
then it would become impossible to represent the situation were a
record of float has a boxed representation, which can arise from
signature instanciation, as in the original post.

Most unfortunate.

Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners