POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
1 Oct 2024 07:19:17 EDT (-0400)
  Re: A test  
From: Warp
Date: 21 Sep 2008 04:56:28
Message: <48d60c3c@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >     case(compare(number, target)) of
> >   What would be wrong with a syntax like that?

> All the functions in Haskell are curried. So it's really
>    case (compare(number)(target)) of ...

  How does Haskell distinguish where a nested (possibly curried) function
call ends, and the outer one continues? Assume that you would want to
write (here in C++ style) something like:

    foo(a, bar(b, c), d, e)

  If you wrote that as a Haskell-style no-delimiters function call,
I suppose it would look like:

    foo a bar b c d e

  Exactly how does Haskell decide how many parameters 'bar' takes there
(and consequently how many of the rest of the parameters are for 'foo')?

  I can't even begin to imagine how you would write that using the
"point syntax", seen in many examples posted by Andrew. Perhaps you
use parentheses to enclose the 'bar' call?

  (Btw, I think this demonstrates one problem with Haskell. I'm an
experienced programmer, and I do have a moderate understanding of the
functional paradigm, and I have been seeing quite many example programs
posted by Andrew during the last years. Yet I'm still completely unable
to figure out or deduce how you could write that in Haskell. It must be
simple, but I just don't know, even though I have seen many examples of
small Haskell programs.
  There just is something about the Haskell paradigm and syntax that
makes it confusing and hard to assimilate.)

-- 
                                                          - Warp


Post a reply to this message

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