From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by pauillac.inria.fr; Thu, 25 Aug 94 16:28:51 +0200 Received: from concorde.inria.fr by pauillac.inria.fr; Mon, 15 Aug 94 12:04:26 +0200 Received: from margaux.inria.fr (margaux.inria.fr [128.93.8.2]) by concorde.inria.fr (8.6.9/8.6.9) with ESMTP id MAA17839 for ; Mon, 15 Aug 1994 12:04:25 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by margaux.inria.fr (8.6.8/8.6.6) with ESMTP id MAA22119 for ; Mon, 15 Aug 1994 12:04:23 +0200 Received: from godard.dfki.uni-sb.de (godard.dfki.uni-sb.de [134.96.188.100]) by concorde.inria.fr (8.6.9/8.6.9) with ESMTP id MAA17835 for ; Mon, 15 Aug 1994 12:04:21 +0200 Received: from localhost by godard.dfki.uni-sb.de id MAA02163; Mon, 15 Aug 1994 12:04:18 +0200 Organization: DFKI Saarbruecken GmbH, D-66123 Saarbruecken (Germany) Date: Mon, 15 Aug 1994 12:04:18 +0200 From: Martin Mueller Message-Id: <199408151004.MAA02163@godard.dfki.uni-sb.de> To: caml-list@margaux.inria.fr Subject: equality between functions Sender: weis@pauillac.inria.fr I am just wondering, why CAML light decided to allow for #let g x = x in g=g;; to succeed with -: bool = true but fail on (eg) #(function x -> x) = (function x -> x);; Uncaught exception: Invalid_argument "equal: functional value" I understand that there are reasons to avoid equality between functions, but then should not equality and inequality be handled symmetrically? For instance, SML/NJ does so and fails on - let fun g x= x in g=g end; std_in:0.0-0.0 Error: operator and operand don't agree (equality type required) operator domain: ''Z * ''Z operand: ('Y -> 'Y) * ('X -> 'X) in expression: = (g,g) Could someone shed some light onto that issue? I would also be interested in pointers to the literature on that topic. Is there a basic reference on equality types? -- Martin M"uller --- Martin M"uller, DFKI, Stuhlsatzenhausweg 3, D-66123 Saarbruecken, Germany Tel: +49 681 302-5329; Fax: +49 681 302-5341; Net: mmueller@dfki.uni-sb.de