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 JAA05712; Fri, 23 Mar 2001 09:08:30 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 JAA05351 for ; Fri, 23 Mar 2001 09:08:29 +0100 (MET) Received: from paille.inria.fr (paille.inria.fr [128.93.11.15]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2N88TX28021 for ; Fri, 23 Mar 2001 09:08:29 +0100 (MET) Received: from inria.fr (paille.inria.fr [128.93.11.15]) by paille.inria.fr (Postfix) with ESMTP id 736F911090; Fri, 23 Mar 2001 08:54:43 +0100 (CET) Message-ID: <3ABB0143.81FB4357@inria.fr> Date: Fri, 23 Mar 2001 08:54:43 +0100 From: Tom Hirschowitz Reply-To: Tom.Hirschowitz@inria.fr X-Mailer: Mozilla 4.73 [fr] (X11; I; Linux 2.2.15-4mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: Dave Berry , caml-list@inria.fr Subject: Re: [Caml-list] recursive modules redux, & interface files References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I prefer Hendrik's suggestion of explicitly including a signature to th= e > 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. = Just curious, but how would you treat this? module type TEN =3D = sig = 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 = struct = includesig TEN ... end Reject? Friendly, = Tom Dave Berry a =E9crit : > = > 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 > 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 ... > = > = > 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= =2Einria.fr ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr