[Haskell-cafe] Exercise in point free-style

Donald Bruce Stewart dons at cse.unsw.edu.au
Fri Sep 1 22:02:55 EDT 2006


haskell:
> Julien Oster wrote:
> 
> >But I'm having problems with one of the functions:
> >
> >func3 f l = l ++ map f l
> 
> While we're at it: The best thing I could come up for
> 
> func2 f g l = filter f (map g l)
> 
> is
> 
> func2p f g = (filter f) . (map g)
> 
> Which isn't exactly point-_free_. Is it possible to reduce that further?

Similarly:

    lambdabot> pl func2 f g l = filter f (map g l)
    func2 = (. map) . (.) . filter

:)


More information about the Haskell-Cafe mailing list