Subject: Re: functional composition 360

> 
> >>
> >> Hi, CC
> >> I can not understand the following ( slide 9-6, 360)
> >>
> >> "id" is "."'s identity element:
> >> id.f = f = f.id
> >>
> >> id::a->a
> >> id x = x
> >>
> >> pls explain more in details, thank you.
> >
> >'id' is the function that returns its argument
> >as result. Composing any function f with id
> >returns a function that is the same as f itself.
> >
> So why does it exist if its does nothing.
> 
>                 f    = f
>                 id.f = f
> 
> Is it redundant as it appears or does it have some hidden use?

Assignment 2 actually uses it, so, yes, it is often useful.

> Question 2 in last years exam uses it but I don't know what it is doing.
> 
> first pr = pr const
> second pr = pr (const id)

I don't we covered 'const' this year, did we?

/CC

___________________________________________________________________________
Christian Collberg      | Email: c_collberg@cs.auckland.ac.nz
Computer Science Dept   | Fax:   +64-9-373-7453
University of Auckland  | Phone: +64-9-373-7599 x 6137
Private Bag 92019,      | WWW:   http://www.cs.auckland.ac.nz/~collberg/
Auckland, NZ            |
___________________________________________________________________________
"Education is an admirable thing, but it is well to remember from time
to time that nothing that is worth knowing can be taught." - Oscar Wilde
___________________________________________________________________________