Re: Functions in the relational context

From: Yagotta B. Kidding <ybk_at_mymail.com>
Date: Sat, 8 Mar 2008 05:37:04 +0100 (CET)
Message-ID: <Xns9A5AF05AE6ED0vdghher_at_194.177.96.26>


Tegiri Nenashi <TegiriNenashi_at_gmail.com> wrote in news:f50e0abb-19a1-4ad9-b958-3f0a7a51e0ec_at_i29g2000prf.googlegroups.com:

> On Mar 7, 12:18 pm, "Yagotta B. Kidding" <y..._at_mymail.com> wrote:

>> here are some examples of high-order
>> functions:
>>
>> 1. 'map': map f1 list1 -- applying an arbitrary function to an
>> arbitrary list (types have to match naturally)

>
> map Char.toUpper "Hello World"?
>
> big deal:
>

Cool !. You do not need to burden your brain with what's not a big deal !

> Enough toy examples. How more interesting programs do look like? I
> googled matrix multiplication:
> http://www.cs.auckland.ac.nz/references/haskell/haskell-intro-html/arra
> ys.html this looks even more awful than procedural! It is certainly no
> match to SQL:
>
> select m1.index1,m2.index2, sum(m1.value*m2.value) from m1,m2
> where m1.index2=m2.index1
> group by m1.index1,m2.index2
>

You appafently forgot what matrix multiplication is ! Your SQL is not that ...

> Perhaps you can suggest some other example where nested loops are
> substituted by elegant combination of fold/map/whatever?
>

Google is your friend.

>
>
Received on Sat Mar 08 2008 - 05:37:04 CET

Original text of this message