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 TAA25548; Thu, 22 Mar 2001 19:05:31 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA25550 for ; Thu, 22 Mar 2001 19:05:30 +0100 (MET) Received: from mrwall.kal.com (mrwall.kal.com [194.193.14.236]) by concorde.inria.fr (8.11.1/8.10.0) with SMTP id f2MI5Tb03340 for ; Thu, 22 Mar 2001 19:05:29 +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_3aba_3f62_0441; Thu, 22 Mar 2001 18:07:30 +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: Thu, 22 Mar 2001 18:04:24 -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: AcCyyBSWaN1ye4PwS4Wj58vp61WkhQALwVug From: "Dave Berry" To: "Hendrik Tews" , Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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: val map: ('a -> 'b) -> 'a list -> 'b list let rec map f l =3D=20 match ... This is one aspect I like about Haskell's syntax. I find it clearer than the current: let rec map (f: 'a -> 'b) (l: 'a list) =3D match ... I prefer Hendrik's suggestion of explicitly including a signature to the earlier suggestion of automatically including types from a signature constraint. If you automatically include types from a signature constraint, the signature stops being a constraint, and you might match signatures that you never intended to. I assume Hendrik is considering the case where an interface already exists, and you're writing the implementation. Another case is where you're writing a module without an explicit interface, but you want to constrain just some of the external view. Using specifications in the module itself might help here too: type coleur =3D Rouge | Vert | Bleu (both type and implementation exported) type animal type animal =3D Chien | Chat | Oiseau (only the type is visible outside the module) 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. Dave. -----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 What about changing include, such that including a signature into a structure includes all types and all exceptions? ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr