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 UAA07408; Thu, 23 Aug 2001 20:53:08 +0200 (MET DST) 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 UAA07277 for ; Thu, 23 Aug 2001 20:53:07 +0200 (MET DST) Received: from beaker.balestra.org (ip20.gte2.rb1.bel.nwlink.com [209.20.176.20]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f7NIr6H03650 for ; Thu, 23 Aug 2001 20:53:06 +0200 (MET DST) Received: (from bradym@localhost) by beaker.balestra.org (8.11.2/8.11.2) id f7NIG2R27797; Thu, 23 Aug 2001 11:16:02 -0700 To: caml-list@inria.fr Subject: Re: [Caml-list] Style question: excessive currying confusion? References: From: Brady Montz Date: 23 Aug 2001 11:16:01 -0700 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Prevost writes: > On 23 Aug 2001, Brady Montz wrote: > > > Suppose I'm reading through someone else's program, and I come across > > the definition for fun2, and I want to know what it does. I can't even > > know how many parameters fun2 takes until I refer to the definition of > > fun1. The confusion is worst when I don't even know I'm confused about > > the number of args fun2 can take. > > Note that thinking in terms of "number of arguments that fun2 can > take" may not be what you want to do, in any case. In a functional > language, functions are often good "data", and make reasonable return > values. Typically, a good API will hide the fact that there's a function > underneath, though. I'm willing to believe this. > Also note that the type of your fun2 (which may or may not be easy for you > to determine) will quickly reveal that it takes more arguments. > > In general, I tend to write out all the parameters when I don't think > it'll be clear, when the functional result isn't being treated as a > "data" result, or when the let restriction would make the function result > monomorphic otherwise. Perhaps it just comes down to: the more clearly defined and/or documented a function is, the easier it is to understand and use. -- Brady Montz bradym@balestra.org ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr