At 7:37 PM +0200 4/5/00, Ralf Muschall wrote:

>Where does the habit to use "flip (.)" in many FP people come
>from?

It's useful for composing several functions in pipeline fashion.

Simon Thompson (in his book _Haskell: the Craft of Functional Programming_)
defines a "forward composition" operator:

        (>.>) :: (a->b) -> (b->c) -> (a->c)
        (>.>) = flip (.)

A composition using this operator, e.g.,

        f >.> g >.> h

is easily understood as a pipeline in which data flows from left to right.
Using ordinary composition (.), the same function would be written

        h . g . f

which can be thought of as a pipeline only if one imagines data flowing
right to left.

--HR



------------------------------------------------------------------
Hamilton Richards Jr.            Department of Computer Sciences
Senior Lecturer                  Mail Code C0500
512-471-9525                     The University of Texas at Austin
SHC 434                          Austin, Texas 78712-1188
[EMAIL PROTECTED]
------------------------------------------------------------------



Reply via email to