[Haskell-cafe] Point-free style

Jacques Carette carette at mcmaster.ca
Mon Feb 14 11:31:15 EST 2005


Thomas Jäger <thjaeger at gmail.com> wrote:
> On Mon, 14 Feb 2005 11:07:48 +0100, Daniel Fischer > And could one define
> > \f g h x y -> f (g x) (h y)
> > 
> > point-free?
> sure,
> ((flip . ((.) .)) .) . (.)

That occurence of flip cannot (AFAIK) be removed, indicating that as far as natural composition is concerned, that 
function above is not quite 'right'.  On the other hand

\f g x h y -> f (g x) (h y)
corresponds to
(((.) .) .) . (.)
Clearly better, no? ;-)

Reducing the 'complexity' by one level, the symmetric version
((.) .) . (. (.))
has the same type as
\f g h x -> f (\f1 y -> g (f1 y)) (h x)

I am curious if the function above has been 'seen' in an application before?

Jacques


More information about the Haskell-Cafe mailing list