From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA11487; Fri, 23 Mar 2001 15:37:25 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA11507 for caml-list@pauillac.inria.fr; Fri, 23 Mar 2001 15:37:24 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA07627 for ; Fri, 23 Mar 2001 11:34:38 +0100 (MET) Received: from mrwall.kal.com (mrwall.kal.com [194.193.14.236]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id f2NAYbX00894; Fri, 23 Mar 2001 11:34:37 +0100 (MET) Received: from mrwall.kal.com [194.193.14.236] (HELO localhost) by mrwall.kal.com (AltaVista Mail V2.0J/2.0J BL25J listener) id 0000_0045_3abb_2740_145a; Fri, 23 Mar 2001 10:36:48 +0000 Subject: RE: [Caml-list] recursive modules redux, & interface files MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Mar 2001 10:33:38 -0000 content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 Message-ID: Thread-Topic: [Caml-list] recursive modules redux, & interface files Thread-Index: AcCzcF5ECglXtZLnSTOaUG6/LcYgBwAE6zZw From: "Dave Berry" To: , Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'd say that the module Ten would have to include a declaration of the sub-module PLAYER. To be honest, I don't know whether there are counter-examples to the suggestion. It may be unsound or impractical. I was just following a single line of thought; I'm sure the idea would require lots more work before it could be adopted, or it might not work at all.=20 -----Original Message----- From: Tom Hirschowitz [mailto:Tom.Hirschowitz@inria.fr] Sent: Friday, March 23, 2001 7:55 To: Dave Berry; caml-list@inria.fr Subject: Re: [Caml-list] recursive modules redux, & interface files Just curious, but how would you treat this? module type TEN =3D=20 sig=20 module PLAYER : sig type t =3D Andre | Pete | Ivan | Cedric val name = : t -> string end exception Not_Ex_No1 of PLAYER.t type u =3D PLAYER.t -> PLAYER.t end module Ten =3D=20 struct=20 includesig TEN ... end Reject? Friendly,=20 Tom Dave Berry a =E9crit : >=20 > To be more general, perhaps specifications could be interleaved with > declarations in modules. In addition to including entire structures, > this would let you specify the type of a function separately from it's > implementation: >=20 > val map: ('a -> 'b) -> 'a list -> 'b list > let rec map f l =3D > match ... >=20 > This is one aspect I like about Haskell's syntax. I find it clearer > than the current: >=20 > let rec map (f: 'a -> 'b) (l: 'a list) =3D > match ... >=20 >=20 > type coleur =3D Rouge | Vert | Bleu > (both type and implementation exported) >=20 > type animal > type animal =3D Chien | Chat | Oiseau > (only the type is visible outside the module) >=20 > I've no idea how easy or hard it would be to incorporate this into > either the semantics or the implementation of the language. But from a > pragmatic point of view, it seems a relatively clean change. >=20 > Dave. >=20 > -----Original Message----- > From: Hendrik Tews [mailto:tews@tcs.inf.tu-dresden.de] > Sent: Thursday, March 22, 2001 12:03 > To: caml-list@inria.fr > Subject: Re: [Caml-list] recursive modules redux, & interface files >=20 > What about changing > include, such that including a signature into a structure > includes all types and all exceptions? >=20 > ------------------- > To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr