RE: Functional composition operator?

From: Don Syme (dsyme@microsoft.com)
Date: Tue Dec 08 1998 - 20:51:25 MET


From: Don Syme <dsyme@microsoft.com>
To: "'akay@sharp.co.uk'" <akay@sharp.co.uk>, caml-list@inria.fr
Subject: RE: Functional composition operator?
Date: Tue, 8 Dec 1998 11:51:25 -0800

Yes, I chose the same operator, which seems very natural.

Don

> > is there a consensus for choice of infix composition operator?
>
> In the end we settled on >> and << for forward and reverse
> composition respectively, satisfying the equations:
>
> (f << g) x = f (g x) = (g >> f) x
>
> The chevrons give a nice feeling of a data pipeline running from g
> to f in each case. Since composition is associative (in the absence
> of side effects) we can write (f << g << h << i), which is
> more elegant
> than (compose (compose (compose f g) h) i), without fear of being
> misunderstood.



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET