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 LAA09005; Fri, 30 Jan 2004 11:36:18 +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 LAA09259 for ; Fri, 30 Jan 2004 11:36:17 +0100 (MET) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0UAaGP27989 for ; Fri, 30 Jan 2004 11:36:16 +0100 (MET) Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 4663820351; Fri, 30 Jan 2004 10:36:16 +0000 (UTC) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03905-01-6; Fri, 30 Jan 2004 11:36:14 +0100 (CET) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 5F44020338; Fri, 30 Jan 2004 11:36:14 +0100 (CET) Received: from seekar.cip.physik.uni-muenchen.de (seekar.cip.physik.uni-muenchen.de [141.84.136.52]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 2713785113; Fri, 30 Jan 2004 11:36:14 +0100 (CET) Received: by seekar.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id EC95C79FD; Fri, 30 Jan 2004 11:36:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by seekar.cip.physik.uni-muenchen.de (Postfix) with ESMTP id E92DF79FB; Fri, 30 Jan 2004 11:36:13 +0100 (CET) Date: Fri, 30 Jan 2004 11:36:13 +0100 (CET) From: Thomas Fischbacher To: William Lovas Cc: caml-list@inria.fr Subject: Re: fancy types (was Re: [Caml-list] ocaml killer) In-Reply-To: <20040129191849.GA9427@force.stwing.upenn.edu> Message-ID: References: <20040127063230.GA12482@inv_machine> <200401282326.i0SNQntl004612@bismarck-chet.watson.ibm.com> <40184A2F.6040007@dcs.qmul.ac.uk> <200401290000.i0T00ntl006988@bismarck-chet.watson.ibm.com> <40184FB9.4000808@dcs.qmul.ac.uk> <200401290034.i0T0Yutl009000@bismarck-chet.watson.ibm.com> <20040129162048.GA29094@force.stwing.upenn.edu> <401945DB.4030106@ps.uni-sb.de> <20040129191849.GA9427@force.stwing.upenn.edu> X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at physik.uni-muenchen.de X-Loop: caml-list@inria.fr X-Spam: no; 0.00; physik:01 caml-list:01 lovas:01 val:01 cip:99 physik:01 cip:99 ocaml:01 int:01 int:01 rec:01 rec:01 wrote:03 recursive:03 types:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 29 Jan 2004, William Lovas wrote: > # type ('a, 'b) specialist = S of (('a, 'b) specialist -> 'a -> 'b);; > type ('a, 'b) specialist = S of (('a, 'b) specialist -> 'a -> 'b) > # let fac n = > let do_rec (S specialist) n = > if n = 0 then > 1 > else > n * specialist (S specialist) n > in > do_rec (S do_rec) n;; > val fac : int -> int = Hm, correct me if I am wrong, but to me this looks as if you had to unnecessarily cons at every recursive call... -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU) ------------------- 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