POV-Ray : Newsgroups : povray.off-topic : I'm in the mood for monads : Re: I'm in the mood for monads Server Time
29 Jul 2024 12:21:39 EDT (-0400)
  Re: I'm in the mood for monads  
From: Warp
Date: 25 Apr 2012 17:02:31
Message: <4f986667@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:
> On 25/04/2012 09:01 PM, Warp wrote:
> > nemesis<nam### [at] gmailcom>  wrote:
> >> Here's the thing about the lambda calculus, which is at the kernel of
> >> haskell the language:  all the functions are one-argument functions that
> >> return other one-argument functions.  So, multiple argument functions
> >> are actually just syntatic sugar for convenience.
> >
> >    But what's the advantage in having only one-argument functions?

> If you're writing a mathematical theory about which computations are 
> possible, then only having to worry about 1-arg functions makes the 
> theory simpler. That's why the lambda calculus does it that way.

  I can believe that. However, what I was really asking was what's the
advantage of having only one-argument functions in a practical programming
language.

> It's useful to be able to quickly throw together a new function by just 
> writing a partial call to an existing one.

  That seems to be a very specialized case. There are tons of other
combinations (eg. in terms of the number of parameters to a function,
among many other things) that can be equally useful.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.