Function composition and currying

Tom Pledger Tom.Pledger@peace.com
Thu, 17 Jul 2003 19:01:28 +1200


K. Fritz Ruehr writes:
 :
 | But Jerzy Karczmarczuk enlightened me as to the full generality possible
 | along these lines (revealing the whole truth under the influence of at
 | least one beer, as I recall). Namely, one can define a sequence of
 | functions (let's use a better notation now, with "c" for composition):
 | 
 |     c1 = (.)                      -- good old composition
 | 
 |     c2 = (.) . (.)                -- my (.<) from above
 | 
 |     c3 = (.) . (.) . (.)
 | 
 |     c4 = (.) . (.) . (.) . (.)
 | 
 |     -- etc.

Nice!

There's also

    c0 = ($)

which is clearer if you use 'non-pointfree' notation

    ...
    c2 f g x y = f (g x y)
    c1 f g x   = f (g x)
    c0 f g     = f  g

- Tom