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: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] Records typing
malc wrote:
> 
> # module type T = sig type t type r = { f : t } end;;
> module type T = sig type t and r = { f : t; }  end
> 
> # module M : T with type t = float = struct
>   type t = float
>   type r = { f : t }
> end;;
> 
> Signature mismatch:
> Modules do not match:
>   sig type t = float and r = { f : t; }  end
> is not included in
>   sig type t = float and r = { f : t; }  end
> Type declarations do not match:
>   type r = { f : t; }
> is not included in
>   type r = { f : t; }
> 
> Is there a way to work around this?

This seems to be a bug. You can work around it using "and" to connect
the type declarations in the structure:

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

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

"Computer games don't affect kids; I mean if Pac Man affected us
 as kids, we would all be running around in darkened rooms, munching
 magic pills, and listening to repetitive electronic music."
 - Kristian Wilson, Nintendo Inc.
-------------------
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