caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brady Montz <bradym@balestra.org>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Style question: excessive currying confusion?
Date: 23 Aug 2001 11:16:01 -0700	[thread overview]
Message-ID: <t88zgad4m6.fsf@balestra.org> (raw)
In-Reply-To: <Pine.LNX.4.21.0108231312400.32015-100000@kinsman.panasas.com>

John Prevost <jprevost@panasas.com> 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


       reply	other threads:[~2001-08-23 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.21.0108231312400.32015-100000@kinsman.panasas.com>
2001-08-23 18:16 ` Brady Montz [this message]
2001-08-23 17:06 Brady Montz
2001-08-23 19:13 ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=t88zgad4m6.fsf@balestra.org \
    --to=bradym@balestra.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).