Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!switch.ch!newsfeed-00.mathworks.com!lon-transit.news.telstra.net!lon-in.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mail
From: Frank Hamersley <terabitemightbe@bigpond.com>
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
MIME-Version: 1.0
Newsgroups: comp.databases.theory
Subject: Re: Aggregation (with GBY) is Relational Division
References: <1149302073.665332.55470@i40g2000cwc.googlegroups.com>   <1149473583.137221.224950@g10g2000cwb.googlegroups.com>   <CUYgg.2121$LN1.271@trndny01> <1149532272.555992.105140@i39g2000cwa.googlegroups.com> <mZ3hg.2193$LN1.351@trndny01>
In-Reply-To: <mZ3hg.2193$LN1.351@trndny01>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 43
Message-ID: <H%8hg.4157$ap3.2253@news-server.bigpond.net.au>
Date: Tue, 06 Jun 2006 06:10:47 GMT
NNTP-Posting-Host: 124.176.168.68
X-Complaints-To: abuse@bigpond.net.au
X-Trace: news-server.bigpond.net.au 1149574247 124.176.168.68 (Tue, 06 Jun 2006 16:10:47 EST)
NNTP-Posting-Date: Tue, 06 Jun 2006 16:10:47 EST
Organization: BigPond Internet Services
Xref: dp-news.maxwell.syr.edu comp.databases.theory:41067

David Cressey wrote:
> "Marshall" <marshall.spight@gmail.com> wrote in message
>> David Cressey wrote:
>>> "Marshall" <marshall.spight@gmail.com> wrote in message
[..]
>>> PS:  can you point me to a web site that will explain "fold" to me?
>> I did a bit of searching and came up with a short intro:
>>
>> http://www.cse.unsw.edu.au/~en1000/haskell/hof.html
[..]
>> Fold is simply inserting a binary operator "in between" the elements
>> in a collection. Usually an ordered, collection, alas. Since it's an
>> ordered collection, they have to do the extra work to take order
>> into account, so you have both foldl and foldr, depending on
>> whether you start at the "left" end of the list or the "right".
>> (Beginning vs. end.)
[..]
>> foldl(append, [], [1, 2, 3])
>>
>> returns [3, 2, 1]
>>
>> Fold depends on being able to separate the first element of a list
>> from the rest, and on the ability to recognize an empty list, but
>> I don't think it needs anything else.
> 
> Thanks for the info on fold.  I think I'm going to try to learn this one.
> It looks useful.
> 
> So fold needs car, cdr, and nil,  but nothing else.  Hmmmmmmm.......

I know its just an intro web page ... but does anyone know how foldr 
disperses the start point?

   eg> fold1 (+) 4 [1..3]   produces a computational sequence 4+1+2+3

so does

   eg> foldr (+) 4 [1..3]   produce 4+3+2+1 or 3+2+1+4?

ie. is the start point element relocated (or not) or would you write it 
as "foldr (+) [1..3] 4"?

Cheers, Frank.
