I am trying to convert the following Haskell code to point free style, to no avail.
bar f g xs = filter f (map g xs )
I\'m new to Haskell a
I asked lambdabot, a robot who hangs out on various Haskell IRC channels, to automatically work out the point-free equivalent. The command is @pl (pointless).
10:41 @pl bar f g xs = filter f (map g xs )
10:41 bar = (. map) . (.) . filter
The point free version of bar is:
bar = (. map) . (.) . filter
This is arguably less comprehensible than the original (non-point-free) code. Use your good judgement when deciding whether to use point-free style on a case-by-case basis.
Finally, if you don't care for IRC there are web-based point-free converters such as pointfree.io, the pointfree command line program, and other tools.