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 CAA22205; Wed, 19 Nov 2003 02:33:58 +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 CAA21884 for ; Wed, 19 Nov 2003 02:33:56 +0100 (MET) Received: from mail.dcs.qmul.ac.uk (vicar.dcs.qmul.ac.uk [138.37.88.163]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAJ1Xu116554 for ; Wed, 19 Nov 2003 02:33:56 +0100 (MET) Received: from xenografia.plus.com ([212.159.85.26] helo=dcs.qmul.ac.uk) by mail.dcs.qmul.ac.uk with asmtp (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.24) id 1AMHE9-000596-EB; Wed, 19 Nov 2003 01:33:53 +0000 Message-ID: <3FBAC862.7010603@dcs.qmul.ac.uk> Date: Wed, 19 Nov 2003 01:33:22 +0000 From: Martin Berger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031009 X-Accept-Language: en-us, en MIME-Version: 1.0 To: skaller@ozemail.com.au CC: Caml Mailing List Subject: Re: [Caml-list] GC and file descriptors References: <1069168323.18363.83.camel@pelican> <3FBA4D97.9060309@dcs.qmul.ac.uk> <1069177584.18363.204.camel@pelican> In-Reply-To: <1069177584.18363.204.camel@pelican> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Auth-User: martinb X-DCS-Spam-Score: -2.5 X-clamav-result: clean (1AMHE9-000596-EB) X-uvscan-result: clean (1AMHE9-000596-EB) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 abstraction:01 forall:01 dependencies:01 decidable:01 inference:01 descriptors:01 float:02 float:02 exception:02 exception:02 dependent:03 argument:03 types:03 exceptions:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > No. The problem is it breaks abstraction. i disagree. the exceptions thrown are part of the specification the function tries to meet. > For example consider > > map f list > > which currently has signature > > ('a -> 'b) -> 'a list -> 'b list i dont see a problem here. simply use exception specification polymorphism: map has type forall A B E: (A -> B throws E) -> list[A] -> list[B] throws E. while i have not thought about this in detail, i dont think there's a type theorectic problem with this. > The problem is that exceptions thrown are typically > implementation details so it would often be an error > to include the exception type in the function signature. i do not think that the exception thrown is an implementation detail > Well, exceptions are 'really' wrong: they're 'really' a constraint > on the type of the argument, for example > > divide: float -> float not zero -> float > > but expressed negatively (throws divide by zero). that's one way of looking at it. another would be to say we have dependent types ... unfortunatly neither rich specifications nor type dependencies lead to decidable type inference so we need to be less precise. martin ------------------- 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