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 VAA09814; Mon, 2 Dec 2002 21:07:08 +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 VAA10069 for caml-list@pauillac.inria.fr; Mon, 2 Dec 2002 21:07:07 +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 IAA22611 for ; Mon, 2 Dec 2002 08:40:19 +0100 (MET) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gB27eI114551; Mon, 2 Dec 2002 08:40:18 +0100 (MET) Received: from univ-savoie.fr (grenoble-1-a7-62-147-74-242.dial.proxad.net [62.147.74.242]) by postfix4-1.free.fr (Postfix) with ESMTP id 8D3ACD9A9; Mon, 2 Dec 2002 08:40:16 +0100 (CET) Message-ID: <3DE9BCD4.8040503@univ-savoie.fr> Date: Sun, 01 Dec 2002 07:40:04 +0000 From: Christophe Raffalli Organization: =?ISO-8859-1?Q?Universit=E9_de_Savoie?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pierre Weis , caml-list@inria.fr Subject: Re: [Caml-list] Understanding why Ocaml doesn't support operator overloading. References: <200211302147.WAA29551@pauillac.inria.fr> X-Enigmail-Version: 0.65.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Pierre Weis wrote: > > Yes: I suspect a really nasty corner in this area. As far as I > remember, the kind of types you suggest is known as ``intersection > types'', and the type reconstruction problem for languages featuring > those types is just undecidable. The big problem with this kind of > stuff is to restrict the type schemes allowed in your type system such > that you do not fall into the undecidable general case, while still > maintaining a powerful enough type system to properly typecheck the > function double (fun x -> x + x). > This is not the only solution: another solution is to keep the simple (in the definition) type system with an incomplete algorithm that will always succeed if enough type information. This works for instance for Mitchell's system F with subtyping (see my normaliser: ) The diffculty is that you need to have a very good way of printing typing error message so that the user can easily guess where to add type information until it works or a real error in the code is detected. Recent work (in a simple setting) by Christian Haack, and Joe Wells let me think that there may be a (non trivial) solution. The big advantage, is that there are (undecidable) type systems that can unifies typing of record, modules and object; functor and functions. Then, you have a simpler type system definition which is easier to extend (with operator overloading, for instance). Remark: it does not change much the picture, because you have to find a subsystem of the simple undecidable system. The difference, is that you can define the subsystem by some limit to the typing complexity in the undecidable system ... This is still far from trivial, but there is a lot of freedom (so place for research :-). -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI ------------------- 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