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 BAA17532; Thu, 4 Jul 2002 01:25:20 +0200 (MET DST) 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 BAA20034 for ; Thu, 4 Jul 2002 01:25:19 +0200 (MET DST) Received: from leia.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g63NPIH17126 for ; Thu, 4 Jul 2002 01:25:18 +0200 (MET DST) Received: by leia.mandrakesoft.com (Postfix, from userid 505) id 3E68E3EF1; Thu, 4 Jul 2002 01:24:33 +0200 (CEST) To: Jacques Garrigue Cc: caml-list@inria.fr Subject: Re: [Caml-list] simple typing question References: <200207022059.WAA29845@pauillac.inria.fr> <20020703104944V.garrigue@kurims.kyoto-u.ac.jp> From: Pixel Date: 04 Jul 2002 01:24:33 +0200 In-Reply-To: <20020703104944V.garrigue@kurims.kyoto-u.ac.jp> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jacques Garrigue writes: [...] > Another problem is that it is asymmetric: partial applications could > be polymorphic, but not results containing several functions: > > let both f = (List.map f, List.iter f) sorry, i don't understand that pb. [...] > let toggle r x = let old = !r in r := x; old > let make_toggle () = let r = ref [] in toggle r or worse: let make_toggle toggle = let r = ref [] in toggle r no way to know how many parameters toggle can have, so no easy way to eta-expand. I think it *can* be done at evaluation time, but I'm not sure. so my response to Francois Pottier was wrong: >> > # let apply f x = f x;; >> > val apply : ('a -> 'b) -> 'a -> 'b = >> > >> > ... You can write applications of `apply' with any >> > numbers of arguments. >> >> you're right... but this isn't a problem for the stuff i'm talking. >> >> If "wrapping-restoring-eta-equivalence" is done based on the number of >> parameters *before* instanciation of type variables, it will do. which was wrong: (even if Francois didn't bother telling :) # let id f = print_string "foo" ; f no simple way to eta-expand. Once again, I think it *can* be done at evaluation time... [...] > So, this seems unlikely such changes would go through. i'm aware of this :) I wanted to note that partial application semantic is somewhat nasty when combined with eager evaluation, and that syntactically & typefully separating functions-returning-functions and partially-applied-functions could ease understanding. One way to do this is to add sugar for partial application of tuples, and having tuples the *default* way of passing parameters. (once again http://merd.net/choices_syntax.html :) Thanks! ------------------- 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